clonemeagain / attachment_preview

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

Plugin not working on v1.16.1 #53

Open elekgeek opened 2 years ago

elekgeek commented 2 years ago

Hello,

Seems the plugin is broken on v1.16.1 since PHP version is now 8.x

tong2x commented 2 years ago

i can confirm it is broken in 1.16.1

clonemeagain commented 2 years ago

Haven't tried it yet, are you getting an error?

tong2x commented 2 years ago

hello, yes, if enabled the ticket wont load and shows a error message that something failed

:-( Not sure what happened.. something broke though.

was initially unable to upgrade to 1.16.1 php 8.1, but read in the forum to disable plugins then individually enable. then installed the plugin with aliitle error but it did install.

hope this can be fixed because this is the coolest plugin in osticket, real really usefull plugin

tong2x commented 2 years ago

any updates?

elekgeek commented 2 years ago

I think this plugin is no longer supported

theking81 commented 2 years ago

I have managed to fix it in 1.16.1 and working.

I have osTicket 1.16.1 and PHP 8.0

I had an error in the beginning after installation where it stated: Unable to enable Attachment Inline Plugin (defunct — missing)

Its was simple fix:

Go first and make sure in include > plugins that the folder name is: AttachmentPreviewPlugin Also make sure that the folder permissions are correct (check 755 or 777)

Then in the folder locate the file: (class.AttachmentPreviewPlugin.php) On my server it was named: class.attachmentpreviewplugin.php

So I renamed it to class.AttachmentPreviewPlugin.php which is the correct file name in the config.php

Deleted in the plugins control panel the plugin and the reinstalled it, and enabled it.

After following these steps you will be ok with the plugin. It works 100%.

tong2x commented 2 years ago

in my case, it still did not work somewhat,

mine is in correct file name... so I uninstalled and reinstalled downgraded php to 8.0 it did somewhat load but not the PDF

it is totally not working in 8.1 with a message something was wrong... and the whole thread wont load

xxx errorscp

theking81 commented 2 years ago

Yes, in 8.1 I think it won't work! But in 8.0 in 1.16.1 it works!

Have you done also all changes after the 1.16.1 release?

From my experience, after upgrading to 1.16.1 I had some issues! I reinstalled all core files, and did all changes after this release as are mentioned here!

After that I reinstalled all plugins and the inline attachment started working again! I do have some plugins not working (not so important) but the most valuable to me it's now working fine!

So try playing around with it! It works 10000%

tong2x commented 2 years ago

hello ok found the issue in mine, the issue was that plugin "Attachments on the filesystem" was set to blank. which the plugin "inline attachment", i guess interprets as an invalid location hence the error "failed to load", It is loading now! This is good news for now

it would be nicer if it would also work with PHP 8.1 and some other dev assume and checks out why it is not working in 8.1. or how to turn on debug mode so the real error will be shown

theking81 commented 2 years ago

OsTicket 1.16.1 it is released for 8.0 not 8.1!

I know they are working on ver 2.0 Keep your php version at 8.0 for a few months until the new release!

Hope that ver 1.16.2 will fix some bugs and make it even more stable!

caygri commented 2 years ago

hello, i install today and I have php 8.0 and not working. I can't install. After click on install nothing happen..

tong2x commented 2 years ago

try to remove or delete and reinstall the plugin

caygri commented 2 years ago

already did, nothing change.

tong2x commented 2 years ago

are you on php 8.0? and what osticket version?

theking81 commented 2 years ago

Ok there is a workaround on this one. Open the class.AttachmentPreviewPlugin.php file and hide the code on line 85:

public static function getInstance() { if (! self::$instance) { throw new Exception( 'Invalid use, please wait for the plugins to Bootstrap properly.'); } return self::$instance; }

And then try again to install the plugin after this change.

alfindlay commented 2 years ago

Hi All, I can also confirm it's not working on my 1.16 OSTicket install on php8.1. I've never been able to get audio files working correctly either even on older versions. Does anyone think it's worth us crowd funding a rewrite, either an official crowd fund or see if we can get the original developer on board and make some donations for their time? Al

perryk commented 2 years ago

This should be working on 1.16 with PHP 8.0.x now. 1.17 works with PHP 8.1 however this plugin only works if you are ok with the default values (or ok with changing the defaults to match what you want). I'm sure someone will be able to fix this plugin in order to make it able to read it's settings again, it is just that the osTicket made significant changes to how plugins work for 1.17.

tong2x commented 2 years ago

which default, default settings of the plugin? would changing the default folder make it not work?

I have not yet upgrade to 1.17

perryk commented 2 years ago

There is a file called config.php which has the defaults of the various settings for this plugin.

It is only with 1.17 where there is trouble reading the settings. This is due to how osTicket has changed handling plugins in order to allow for multiple instances of plugins.

alfindlay commented 2 years ago

Thanks for the info @perryk but I am unable to get this to work with v1.16.3 running on php 8.0.24 I wonder if it's my environment. Are you saying that the plugin works on v1.17. What has changed to allow the legacy plugin to start working again?

perryk commented 2 years ago

I'll give it another shot with 1.16.3 but I'm pretty sure it was working fine for 1.16 for me with the most recent code changes to this plugin.

It doesn't work in 1.17 for me, it will display an attachment if it below the attachment-size default amount, not matter what settings I have configured for the plugin to increase that variable.

Generally it doesn't look to be able to read the settings properly at all and this matches with other troubles with older plugins since 1.17 introduced the capability to have multiple instances of plugins.

Without the most recent code changes for PHP 8.0.x I was receiving a Internal Server 500 error with a message in the apache or php logs complaining about a error from the plugin.

What error or trouble do you have with 1.16.3 ?

tong2x commented 2 years ago

will 1.17 and php lower than PHP8.0 will work?

perryk commented 2 years ago

No, OsTicket itself requires PHP 8.0.x or higher in order to run version 1.17.

nandi96 commented 2 years ago

The Hide Attachment / Show attachment buttons are disappeared after 1.16. update. (The Pdf viewer function still works correctly.) How Can I fix this problem?