webcomic
webcomic copied to clipboard
Ajax Admin error 500 on media / post media upload page
Expected Behavior
Media files for pages uploading correctly via media upload button or media page
Current Behavior
Both pages bring up Media upload page won't upload. Error "/admin-ajax.php 500"
Context
I'm unable to upload comic pages's images either via direct upload on the page or in the media page. The result is a permanent spinning loading loop. Only happens with the webcomic plugin enabled.
Example
Comic Page -> Add new (or edit) -> Add Media
Or Media page ->
Environment
- Webcomic Version 5.0.6
- WordPress 5.9.2
- PHP 8.0.2
- Chrome
Other notes
Other users reporting same bug https://wordpress.org/support/topic/activating-webcomic-prevents-media-library-thumbnails-gallery-from-loading/
Previous bug I exprerienced but manually fixed was https://wordpress.org/support/topic/filters-php-outdated-fixed-it-for-now/ (was more straight forward, just swapping object declaration $suffix = $match{2}; -> $suffix = $match[2];
)
Having the same issue. I think all of the PHP deprecations in 7.4 and 8.0 are catching up with Webcomic.
Confirmed that this issue resolves if the server is rolled back to PHP 7.3, which is obviously not a long-term solution. Most hosting environments have already forced updates to 7.4 and it won't be long before that's 8.0.
ETA: Media functions still work after switching back to PHP 7.4 after briefly having it as 7.3. I imagine that this is temporary though and that something elsewhere in the codebase will trigger the issue again at some point.
Error log is just this over and over again.
[03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/collection/settings/general.php on line 329 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/taxonomy/media.php on line 154 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 372 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 393 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 414 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/age.php on line 243 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/password.php on line 161 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/roles.php on line 248 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/twitter/settings.php on line 433 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/twitter/metabox/status.php on line 337 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/collection/settings/general.php on line 329 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/taxonomy/media.php on line 154 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 372 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 393 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 414 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/age.php on line 243 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/password.php on line 161 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/roles.php on line 248 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/twitter/settings.php on line 433 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/twitter/metabox/status.php on line 337 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/collection/settings/general.php on line 329 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/taxonomy/media.php on line 154 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 372 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 393 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 414 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/age.php on line 243 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/password.php on line 161
Confirmed that this issue resolves if the server is rolled back to PHP 7.3, which is obviously not a long-term solution. Most hosting environments have already forced updates to 7.4 and it won't be long before that's 8.0.
ETA: Media functions still work after switching back to PHP 7.4 after briefly having it as 7.3. I imagine that this is temporary though and that something elsewhere in the codebase will trigger the issue again at some point.
Error log is just this over and over again.
[03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/collection/settings/general.php on line 329 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/taxonomy/media.php on line 154 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 372 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 393 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 414 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/age.php on line 243 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/password.php on line 161 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/roles.php on line 248 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/twitter/settings.php on line 433 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/twitter/metabox/status.php on line 337 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/collection/settings/general.php on line 329 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/taxonomy/media.php on line 154 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 372 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 393 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 414 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/age.php on line 243 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/password.php on line 161 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/roles.php on line 248 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/twitter/settings.php on line 433 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/twitter/metabox/status.php on line 337 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/collection/settings/general.php on line 329 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/taxonomy/media.php on line 154 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 372 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 393 [03-May-2022 20:44:58 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in /wp-content/plugins/webcomic/lib/restrict/settings.php on line 414 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/age.php on line 243 [03-May-2022 20:44:58 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/webcomic/lib/restrict/metabox/password.php on line 161
Yes I ended up manually editing all. the mentions of array_unique and removed some checks to help it function with php 8 which works for now, i'll leave it disabled from updating till i get a version from you and not my hacky attempt at fixing individual functions till error logs go away
@luckyde An update was pushed a few weeks ago (Webcomic version 5.0.8) which resolves this specific issue (by casting all the objects as arrays prior to passing them to the function), though this update hasn't been reflected on Github at all.
Also unsure if there are other PHP8 compatibility issues that still need to be resolved.
I'm working on getting the GitHub repo synced with the WordPress release SVN. As far as I'm aware there are no other PHP 8 incompatibilities in Webcomic.