Open dd32 opened 1 month ago
It appears this may have been introduced in Core via https://core.trac.wordpress.org/changeset/48416 / https://core.trac.wordpress.org/ticket/48011 / WP 5.5, although I can't confirm if the error would've simply been something else before then (As it would have called wp_update_post( [ 'post_parent' => WP_Error, ...
)
Filed upstream in https://core.trac.wordpress.org/ticket/61799
This bug is in WordPress core, but I think it can only be triggered through an import, so I'm filing the initial details here. This might be resolved via Core, or maybe it should be handled in the Importer.
Reported in the forums: https://wordpress.org/support/topic/uncaught-error-object-of-class-wp_error-could-not-be-converted-to-string-7/
Duplicated in Playground
This could also be triggered by using a plugin that adds a taxonomy, add that taxonomy to a menu, and then export/import into a new site without that plugin.
Fatal error:
Example WXR that triggers this mywordpresswebsite.WordPress.2024-08-01.xml.zip which can be uploaded at this playground instance and you'll then see the error in the browser console.
The Core lines that triggers it: https://github.com/WordPress/wordpress-develop/blob/50af37a9083f003f8e98d089091d2cc428797cc5/src/wp-includes/nav-menu.php#L496
$original_title
is aWP_Error
as it's an unknown taxonomy in$args['menu-item-object']
.Core could avoid this as it does elsewhere in that code, or the Importer could not import unknown taxonomy items.