PHP Warning: array_shift() expects parameter 1 to be array, object given in /var/www/html/lib/pkp/classes/core/PKPRouter.inc.php on line 485

Description of issue or problem I’m having:
I am attempting to list the installed plugins in the backend interface, Website Settings → Plugins, but the operation doesn’t complete (no console errors, i.e. 500 Internal Server Error is not present).

The only error in the logs is this:

PHP Warning:  array_shift() expects parameter 1 to be array, object given in /var/www/html/lib/pkp/classes/core/PKPRouter.inc.php on line 485

Steps I took leading up to the issue:
Went to the backend interface and attempted to list installed plugins. (I wanted to change some plugin settings)

What I tried to resolve the issue:
Looked in the forums for something similar but nothing specific to this error has been found.

Application Version - e.g., OJS 3.1.2:
OJS 3.3.0.10

Does anyone know of a solution to this?

Many thanks in advance.

Quick update on this one. Both my localhost and online dev server both now fail to list available plugins in the backend. The only error in the logs is the same as outline above:

[Mon Jun 27 13:50:56.283450 2022] [php7:warn] [pid 17620:tid 1812] [client ::1:58649] PHP Warning:  array_shift() expects parameter 1 to be array, object given in C:\\xampp\\htdocs\\ojs\\lib\\pkp\\classes\\core\\PKPRouter.inc.php on line 485, referer: http://localhost/ojs/index.php/ve/management/settings/website

I can’t uninstall the plugins in the normal manner because I can’t list them in the backend interface. Simply deleting them doesn’t appear to work either.

Does anyone else have any insights into why this isn’t working? Kinda stuck until I can get around this current obstacle!

Hi @Ant_Forshaw,

The warning shouldn’t be a problem – I suspect that there’s a more relevant error message to be found. If your server has configured your PHP and Apache errors to go to different logs, you might try reading the Apache log. A 500 response means that something more than a warning should definitely be logged on the server.

Regards,
Alec Smecher
Public Knowledge Project Team

Hmm, the message was from the apache log. Apart from that, the only other symptom is that the plugins page doesn’t list plugins at all. Just hangs there. I was hoping there would have been some other indication as to why it isn’t working but I can’t find anything.

I don’t even know where to start here. Do I manually delete the plugins one at a time in the hope that it starts to work again?

Hi @Ant_Forshaw,

Ah, I misread your above post (“500 Internal Server Error is not present”).

I would suggest using your browser’s console (often called “developer tools”) to check…

  • if there is an error message on the browser’s console
  • if there is a request that is taking a long time, or something else suspicious on the Network tab

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you @asmecher ,

I manually deleted my plugins (3 of them) and manually removed their entries in plugin_settings and versions tables and then reinstalled.

Two of the plugins worked OK, but after installation of the third plugin using the backend interface, the plugins list stopped working again, so I’ve narrowed it down to a single plugin but have no real idea why that isn’t working. No internal server errors, nothing pertinent in the error logs but the plugins list simply fails to load.

If I could identify why this one isn’t working then I believe I should be able to continue, but at the moment I’m clueless as to why this one plugin causes the list to fail to load. I shall pick through my code until I spot something… hopefully it will be obvious.

I spotted an issue with my code, and now that it has been corrected, the plugin is working and I can ignore the warning in the logs… bit of a red herring that had me confused for a time.

Thank you for your patience :slight_smile: I still feel like an OJS noob but learning.

Hi @Ant_Forshaw,

Glad to hear it’s resolved. It’s such a big codebase, all of us are newbies to at least part of it… :clown_face:

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like