osticket-plugin-mentioner icon indicating copy to clipboard operation
osticket-plugin-mentioner copied to clipboard

PHP errors with osTicket v1.16.1

Open JVC-MSF-OCB opened this issue 2 years ago • 4 comments

Hey it appears that with the latest version of osTicket (v1.16.1), which is running on PHP8, this plugin returns a fatal error.

Any plans to update the plugin :-) ?

PHP Fatal error: Declaration of MentionerPlugin::uninstall() must be compatible with Plugin::uninstall(&$errors) in /var/www/html/include/plugins/mentioner/class.MentionerPlugin.php on line 458

osTicket v1.16.1 // osTicket-1.16.1-Awesome-101 PHP 8.1.3 // MySQL 5.7.36 // Apache/2.4.52 (Debian) web server

JVC-MSF-OCB avatar Mar 16 '22 08:03 JVC-MSF-OCB

Referring to similar error at https://github.com/clonemeagain/plugin-autocloser/issues/39

Same fatal error with PHP 8.0.17:

[Thu Apr 21 07:33:08.987921 2022] [mpm_prefork:notice] [pid 21] AH00163: Apache/2.4.53 (Debian) PHP/8.0.17 configured -- resuming normal operations
[Thu Apr 21 07:33:08.987987 2022] [core:notice] [pid 21] AH00094: Command line: 'apache2 -D FOREGROUND'
[Thu Apr 21 07:33:39.212368 2022] [php:error] [pid 37] [client 127.0.0.1:41912] PHP Fatal error:  Declaration of MentionerPlugin::uninstall() must be compatible with Plugin::uninstall(&$errors) in /var/www/html/include/plugins/mentioner/class.MentionerPlugin.php on line 458

XKa-MSF-OCB avatar Apr 21 '22 07:04 XKa-MSF-OCB

@clonemeagain

Fatal errors seem to be suppressed (but not sure if a proper fix) with the following 1 amendment:

  • changing the method signature at: https://github.com/clonemeagain/osticket-plugin-mentioner/blob/c2a8bcd93a8d559b783871a7843903ce2d1a9ff2/class.MentionerPlugin.php#L462 ... to:
function uninstall(&$errors) {

Hope this may help.

Thank you very much for providing this useful osTicket plugin. 👍🏽

XKa-MSF-OCB avatar Apr 21 '22 08:04 XKa-MSF-OCB

@clonemeagain

Fatal errors seem to be suppressed (but not sure if a proper fix) with the following 1 amendment:

* changing the method signature at:
  https://github.com/clonemeagain/osticket-plugin-mentioner/blob/c2a8bcd93a8d559b783871a7843903ce2d1a9ff2/class.MentionerPlugin.php#L462
  
  ... to:
function uninstall(&$errors) {

Hope this may help.

Thank you very much for providing this useful osTicket plugin. 👍🏽

I came on this issue separately and will note that It appears that the devs for OSTicket made similar changes from a pull request here to deal with issues deleting plugins in php 7.2.

https://github.com/osTicket/osTicket/pull/4722/files

fwiw, I've forked this repo and made that same change (the one you note here). The mentioner plugin still seems to work as expected with php 8.0.21 with this change.

bobweston avatar Aug 05 '22 20:08 bobweston

@bobweston

fwiw, I've forked this repo and made that same change Can you submit a PR for that change?

clonemeagain avatar Oct 04 '22 04:10 clonemeagain