Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brozkeff opened this issue Apr 2, 2024 · 1 comment · May be fixed by #50

Comments

@brozkeff
Copy link

brozkeff commented Apr 2, 2024

  • Dokuwiki: Release 2023-04-04a "Jack Jackrum"
  • OS: Ubuntu server 22.04.4 LTS
  • Apache: 2.4.52-1ubuntu4.8
  • PHP: PHP 7.4.33

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants