gkrid / dokuwiki-plugin-approve

GNU General Public License v2.0
4 stars 17 forks source link

PHP Warning E_WARNING: in_array() expects parameter 2 to be array, null given in ApproveMetadata.php(35) #49

Open brozkeff opened 8 months ago

brozkeff commented 8 months ago

I've encountered a recurring PHP warning in the logs, which floods the logs. The warning is as follows:

2024-04-02 15:20:03E_WARNING: in_array() expects parameter 2 to be array, null given/var/www/tierrawiki/lib/plugins/approve/meta/ApproveMetadata.php(35)
    #0 [internal function]: dokuwiki\ErrorHandler::errorHandler()
    #1 /var/www/tierrawiki/lib/plugins/approve/meta/ApproveMetadata.php(35): in_array()
    #2 [internal function]: dokuwiki\plugin\approve\meta\ApproveMetadata->dokuwiki\plugin\approve\meta\{closure}()
    #3 /var/www/tierrawiki/lib/plugins/approve/meta/ApproveMetadata.php(37): array_filter()
    #4 /var/www/tierrawiki/lib/plugins/approve/action/notification.php(62): dokuwiki\plugin\approve\meta\ApproveMetadata->getPages()
    #5 /var/www/tierrawiki/inc/Extension/EventHandler.php(80): action_plugin_approve_notification->add_notifications()
    #6 /var/www/tierrawiki/inc/Extension/Event.php(96): dokuwiki\Extension\EventHandler->process_event()
    #7 /var/www/tierrawiki/inc/Extension/Event.php(136): dokuwiki\Extension\Event->advise_after()
    #8 /var/www/tierrawiki/inc/Extension/Event.php(199): dokuwiki\Extension\Event->trigger()
    #9 /var/www/tierrawiki/inc/deprecated.php(341): dokuwiki\Extension\Event::createAndTrigger()
    #10 /var/www/tierrawiki/lib/plugins/notification/action/cron.php(69): trigger_event()
    #11 /var/www/tierrawiki/inc/Extension/EventHandler.php(80): action_plugin_notification_cron->handle_indexer_tasks_run()
    #12 /var/www/tierrawiki/inc/Extension/Event.php(96): dokuwiki\Extension\EventHandler->process_event()
    #13 /var/www/tierrawiki/inc/TaskRunner.php(55): dokuwiki\Extension\Event->advise_after()
    #14 /var/www/tierrawiki/lib/exe/taskrunner.php(16): dokuwiki\TaskRunner->run()
    #15 {main}

In addition to that a lot of deprecation warnings appear in logs, e.g.

2024-04-02 15:27:30require(syntax.php) is deprecated. It was called from require() in /var/www/tierrawiki/lib/plugins/approve/action/notification.php:8 Autoloading should be used instead!
2024-04-02 15:27:30helper_plugin_sqlite::init() is deprecated. It was called from helper_plugin_approve_db::init() in /var/www/tierrawiki/lib/plugins/approve/helper/db.php:54 dokuwiki\plugin\sqlite\SQLiteDB should be used instead!

However mostly the plugin still seems to work OK. Is there a problem in the dokuwiki version used (not sure if trying to upgrade to latest release is good idea when there are already deprecation warnings in the previous version now used) or php version being used? (7.4 is obsolete but I require it to run owncloud on the same server + some other dokuwiki plugins I use also have php deprecation already on 7.4 and would fail on 8.x so I am stuck on 7.4 for now until these issues are resolved)

solewniczak commented 5 months ago

Pleas try new version of plugin (2024-07-06). Hope this helps!