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

Ajax Admin error 500 on media / post media upload page #375

Open
luckyde opened this issue Mar 29, 2022 · 5 comments
Open

Ajax Admin error 500 on media / post media upload page #375

luckyde opened this issue Mar 29, 2022 · 5 comments

Comments

@luckyde
Copy link

luckyde commented Mar 29, 2022

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
image

Or Media page ->
image

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];)

@luckyde luckyde changed the title Ajax Admin error 500 on media page Ajax Admin error 500 on media page and on post media upload page Mar 29, 2022
@luckyde luckyde changed the title Ajax Admin error 500 on media page and on post media upload page Ajax Admin error 500 on media / post media upload page Mar 29, 2022
@ykyu
Copy link

ykyu commented May 3, 2022

Having the same issue. I think all of the PHP deprecations in 7.4 and 8.0 are catching up with Webcomic.

@ykyu
Copy link

ykyu commented May 3, 2022

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

@luckyde
Copy link
Author

luckyde commented May 31, 2022

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

@ykyu
Copy link

ykyu commented May 31, 2022

@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.

@mgsisk
Copy link
Owner

mgsisk commented May 31, 2022

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.

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

No branches or pull requests

3 participants