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: Custom Work
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 |
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 ❌ Look forward to your reply. |
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. Also, there isn't an option to cc the email notification to another email address. Look forward to your reply. |
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. |