Fatal error: Uncaught Error: Cannot use object of type WP_Error as array
-
Hello, my wordpress website is showing PHP fatal error
Fatal error: Uncaught Error: Cannot use object of type WP_Error as array
in /home/www/diplomaticwatch.com/wp-includes/media.php on line 260The previously uploaded media files are not loading up in the admin dashboard. See attached screenshot
How can i possible fix this problem. I will appreciate your assistance
The page I need help with: [log in to see the link]
-
Try manually resetting your plugins (no Dashboard access required). If that resolves the issue, reactivate each one individually until you find the cause.
If that does not resolve the issue, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel (consult your hosting provider’s documentation for specifics on these), navigate to /wp-content/themes/ and rename the directory of your currently active theme. Hopefully, this will force the default theme to activate and rule out a theme-specific issue (theme functions can interfere like plugins).
I deactivated all the plugins………… it was still showing the error
I renamed the theme, so it can force the default 2024 theme…….it couldn’t load the default theme
I changed the theme from the dashboard to default theme ……it was still showing the error
I Changed the PHP version from version to PHP 8.2 and the recent PHP 8.3………it was still showing the error below
Images in the media gallery wont display and it’s showing the error below…….i wish i could attach screenshotFatal error: Uncaught Error: Cannot use object of type WP_Error as array
in /home/www/diplomaticwatch.com/wp-includes/media.php on line 260Call stack:
image_downsize()
wp-includes/media.php:970wp_get_attachment_image_src()
wp-includes/media.php:1060wp_get_attachment_image()
wp-admin/includes/class-wp-media-list-table.php:456WP_Media_List_Table::column_title()
wp-admin/includes/class-wp-list-table.php:1791WP_List_Table::single_row_columns()
wp-admin/includes/class-wp-media-list-table.php:736WP_Media_List_Table::display_rows()
wp-admin/includes/class-wp-list-table.php:1706WP_List_Table::display_rows_or_placeholder()
wp-admin/includes/class-wp-list-table.php:1633WP_List_Table::display()
wp-admin/upload.php:455
And when i try to upload images to an article it shows the error below
The server cannot process the image. This can happen if the server is busy or does not have enough resources to complete the task. Uploading a smaller image may help. Suggested maximum size is 2560 pixels.
Please i need solution
WordPress is not yet fully compatible with PHP 8.3. Do you still have the same issue under PHP 8.1?
yes, it’s displaying error on PHP 8.1
Ok, from Dashboard > Updates in your Dashboard, click the “Re-install version 6.5.5” button.
This will only reinstall the core files, it won’t affect any of your site’s content or configuration.
Thanks James
I re-installed version 6.55 now as you have suggested. The error is still showingFatal error: Uncaught Error: Cannot use object of type WP_Error as array
in /home/www/diplomaticwatch.com/wp-includes/media.php on line 260Call stack:
image_downsize()
wp-includes/media.php:970wp_get_attachment_image_src()
wp-includes/media.php:1060wp_get_attachment_image()
wp-admin/includes/class-wp-media-list-table.php:456WP_Media_List_Table::column_title()
wp-admin/includes/class-wp-list-table.php:1791WP_List_Table::single_row_columns()
wp-admin/includes/class-wp-media-list-table.php:736WP_Media_List_Table::display_rows()
wp-admin/includes/class-wp-list-table.php:1706WP_List_Table::display_rows_or_placeholder()
wp-admin/includes/class-wp-list-table.php:1633WP_List_Table::display()
wp-admin/upload.php:455
Interesting, line 260 shouldn’t be causing an issue on its own, especially on the front end: https://core.trac.ww.wp.xz.cn/browser/tags/6.5.5/src/wp-includes/media.php#L260
Is your file modified? Do you have any plugins you missed under the rarely used /wp-content/mu-plugins/ ?
we just noticed the error on the 30th of June.
No file was modified on that day or prior to that day. I have disabled all plugins and theme to default. Still showing the error
-
This reply was modified 1 year, 11 months ago by
papisean.
There was also no WordPress release on June 30: https://ww.wp.xz.cn/news/category/releases/
Can you restore to a backup from June 29, or at least compare differences between the files?
I asked the hosting company to do a restoration to 28th of June yesterday, they did and the error was still showing.
I then asked them to restore it back to the recentIt seems like your reply got cut off.
So till now the error is still showing.
Please what else can i do to remove this error. Old images uploaded to the website are not displaying in the media area. Though they display on the website front end.Only the images uploaded from the 1st of July are displaying at the media area of the dashboard
Is the media issue new, or did that start when the whole problem started?
Is there an available pre-incident backup? If you have multiple options, maybe try 1 or 2 weeks ago.
If I can still get involved:
The error message indicates a problem with meta data of one or more images. You wrote at the very beginning that this only happened with the newest files. Can you provide the original files here if necessary? Importing an older backup should help in any case.You can also provide screenshots as described here: https://ww.wp.xz.cn/support/forum-user-guide/block-editor/#adding-screenshots
@macmanx the only issue is the media file. every other thing on the website is working fine.
There was no pre-incident event to my knowledge. Everything was working fine prior to 29th of June when my attention was brought to the issue of old images not loading up in the media segment. To even upload new images wasn’t working at that time.
But now, new images can be uploaded. But old images are not loading up
The topic ‘Fatal error: Uncaught Error: Cannot use object of type WP_Error as array’ is closed to new replies.