attachment_preview icon indicating copy to clipboard operation
attachment_preview copied to clipboard

Fix: Use correct config

Open t-oster opened this issue 1 year ago • 1 comments

The getConfig() mehtod only works correctly in the bootstrap method of the plugin. In all other mehtods, it will only return the default configuration, which causes #61

This PR will save the correct configuration in a static variable during the bootstrap call and override the getConfig method to return that variable, if it is set.

The only thing where this could cause problems is if you have multiple instances of this plugin, which is a new feature of OsTicket (where I have no idea for a use case), but I cannot imagine a useful scenario where you would need multiple instances of the Attachment Preview Plugin.

t-oster avatar Apr 04 '23 08:04 t-oster

This fixes an issue on 1.17.5 and 1.18 where the plugin fails to install and/or crashes osTicket, suggest this fix be merged, however underlying issue with pdf (audio and video as well) not implementing still present, likely in .js

buff0k avatar Nov 29 '23 06:11 buff0k