clonemeagain / attachment_preview

osTicket Plugin: Allows inline view of attachments
GNU General Public License v2.0
48 stars 16 forks source link

Fix: Use correct config #62

Open t-oster opened 1 year ago

t-oster commented 1 year ago

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.

buff0k commented 1 year ago

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