Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by mariyaB 1 year, 3 months ago.

Assisted by: Long Nguyen.

Author Posts
August 24, 2023 at 5:44 pm #14287693

mariyaB

appserver_1 | NOTICE: PHP message: PHP Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, WP_Error given in /app/web/wp/wp-includes/taxonomy.php:1921
appserver_1 | 192.168.160.3 - 24/Aug/2023:17:39:39 +0000 "POST /wp-admin/admin-ajax.php" 500
appserver_1 | Stack trace:
appserver_1 | #0 /app/web/wp/wp-includes/taxonomy.php(1921): array_map('intval', Object(WP_Error))
appserver_1 | #1 /app/web/wp/wp-includes/post.php(6364): wp_delete_object_term_relationships(130, Array)
appserver_1 | #2 /app/web/wp/wp-includes/post.php(3381): wp_delete_attachment(130, false)
appserver_1 | #3 /app/web/wp/wp-admin/includes/ajax-actions.php(867): wp_delete_post(130)
appserver_1 | #4 /app/web/wp/wp-includes/class-wp-hook.php(308): wp_ajax_delete_post('delete-post')
appserver_1 | #5 /app/web/wp/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
appserver_1 | #6 /app/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
appserver_1 | #7 /app/web/wp/wp-admin/admin-ajax.php(188): do_action('wp_ajax_delete-...')
appserver_1 | #8 {main}
appserver_1 | thrown in /app/web/wp/wp-includes/taxonomy.php on line 1921

August 24, 2023 at 7:53 pm #14288067

mariyaB

Support requested fully updating plugins and attempting again.

Have note updated WordPress to 6.3 yet, but still unable to delete media attachments from the Media Library.

August 28, 2023 at 6:30 am #14297271

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Mariya,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.

Look forward to your reply.
Thanks

September 6, 2023 at 3:49 am #14348247

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

If I switch the theme to a standard one of WordPress, I can delete the image properly. Can you please confirm it works on your side?

You are using a custom theme Sage and I think there could be an issue with the image permalink in your custom code. I'm afraid that that helping you with custom code, is out of the scope of WPML.
If you are not able to fix the issue, I would recommend you contact one of our certified partners who will be more than happy to help you with this. In this link, you will find a list of our certified partners: https://wpml.org/contractors/

Also, there isn't an option to cc the email notification to another email address.

Look forward to your reply.
Thanks

September 6, 2023 at 3:04 pm #14353593

mariyaB

Long,

We chose the Sage theme because it was on the list of "Compatible" themes: https://wpml.org/theme/sage-starter-theme/

That said, I did find one part of our customization within the theme which was partially causing the issue (noted here: hidden link ).

WordPress has "wp_delete_object_term_relationships( $post_id, array( 'category', 'post_tag' ) );" hard-coded within 'wp-includes/post.php', so the two taxonomies MUST exist.

----

That said, whereas it now successfully is deleting the attachment, it still drops an error (but this time nothing in debug.log and/or console.log) when deleting.

So its no longer full-blocking, but also does not occur unless the WPML suite of plugins is activated.

~~ Charles

September 6, 2023 at 5:05 pm #14354291

mariyaB

The errors were coming from my remaining debugging code. Once the taxonomies existed again, the items were able to be deleted. Appears unrelated to WPML, but **seemed** to come from WPML due to the post-type duplications.