This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing a fatal error when trying to automatically translate a Custom Post Type (CPT) post created with JetEngine using the WPML Multilingual CMS plugin. The error message indicates a 'TypeError: array_diff(): Argument #2 must be of type array, string given' in the WPML plugin's custom field synchronization script. Solution: We recommend the following steps to resolve the issue: 1. Navigate to JetEngine -> Post Types. 2. Edit the Events post type. 3. Disable the "Custom Meta Storage (Beta)" option. 4. Update the Post Type. 5. Edit an Event post in the default language. 6. Make a minor edit and update it. 7. Update the translation.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.
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.
Background of the issue:
I am trying to automatically translate a CPT post on my site hidden link. The CPT post was created with JetEngine. I am not following any specific documentation. Upon creating a CPT post, I encountered an error with the WPML Multilingual CMS plugin.
My WordPress version is 6.7.2, the active theme is BuddyBoss Theme version 2.7.50, the current plugin version is WPML Multilingual CMS 4.7.3, and my PHP version is 8.3.13.
Symptoms:
WordPress caught an error with the WPML Multilingual CMS plugin. The error message is: Uncaught TypeError: array_diff(): Argument #2 must be of type array, string given in /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/classes/custom-field-translation/class-wpml-sync-custom-fields.php:61.
Here's the full error:
An error of type E_ERROR was caused in line 61 of the file /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/classes/custom-field-translation/class-wpml-sync-custom-fields.php. Error message: Uncaught TypeError: array_diff(): Argument #2 must be of type array, string given in /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/classes/custom-field-translation/class-wpml-sync-custom-fields.php:61
Stack trace:
#0 /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/classes/custom-field-translation/class-wpml-sync-custom-fields.php(61): array_diff(Array, '700-800')
#1 /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1640): WPML_Sync_Custom_Fields->sync_custom_field(12346, '12352', 'attendees')
#2 /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1653): SitePress->sync_custom_field(12346, '12352', 'attendees')
#3 /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-synchronization.class.php(327): SitePress->copy_custom_fields(12346, '12352')
#4 /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-synchronization.class.php(253): WPML_Post_Synchronization->sync_custom_fields(12346, '12352')
#5 /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-translation.class.php(206): WPML_Post_Synchronization->sync_with_translations(12346, Array)
#6 /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-admin-post-actions.class.php(123): WPML_Post_Translation->after_save_post('126345', Array, 'en', NULL)
#7 /www/masterdistillers_389/public/wp-includes/class-wp-hook.php(326): WPML_Admin_Post_Actions->save_post_actions('12346', Object(WP_Post))
#8 /www/masterdistillers_389/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#9 /www/masterdistillers_389/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#10 /www/masterdistillers_389/public/wp-includes/post.php(5060): do_action('save_post', 12346, Object(WP_Post), true)
#11 /www/masterdistillers_389/public/wp-includes/post.php(5162): wp_insert_post(Array, false, true)
#12 /www/masterdistillers_389/public/wp-admin/includes/post.php(453): wp_update_post(Array)
#13 /www/masterdistillers_389/public/wp-admin/post.php(227): edit_post()
#14 {main}
thrown
Questions:
How can I resolve the fatal error caused by the WPML Multilingual CMS plugin?
Is there a way to automatically translate a CPT post without encountering this error?
I'm not sure if this is related, but in WPML error logs, I see this:
Event: Job Download
Description:
array_diff(): Argument #2 must be of type array, string given /www/masterdistillers_389/public/wp-content/plugins/sitepress-multilingual-cms/classes/custom-field-translation/class-wpml-sync-custom-fields.php:61
WPML Job ID: 1826
ATE Job ID: 136751454
Extra data:
{"downloadUrl":"https:\/\/ate-production.s3proxy.wpml.org\/translated_xliffs\/xliffs\/096\/964\/823\/original\/translated_135486033_Tequila__amp__mezcal_festival_Gdansk20250413-8222-17s4btk.xliff20250413-8644-nkqp96.xliff?Expires=1745196691&Signature=UuryFosw-dx9ns2n3CWA38MJakQWsEM6ZJmzMuVzXd8NDh9-3mdTVh1q4vVel66FwCVDufvoZ0ntloNw-3t4u6V1nYz~QXpbV9UQ7npkHFo8hCgjwN6Ur5-OWU4hpM7IKERf6w3JFQGG9b210bzPiqXlR1eqWwaFVNouRf-iZZm-bk2k0W3D7ewuruQMQU85wpecmH20ZP~RdiIPLneQzCLKDBf9gerXrTw-gnATUTZaoj7TtUtN8-6T0CPDO~TjOvssTqtr3WVb4G7sOcFyZefuIlrMFbjM-DXvGI~-AGbCvcBngIL1Ptk5AAwGIh2ymxe7yFfNmTd5~pQ-qZMbDA__&Key-Pair-Id=K1C11UVRQNXLRQ"}
Thanks for contacting WPML forums support. I'll be glad to help you today.
First of all, sorry for the late reply; it was due to a higher workload.
Please share an example of the problematic posts so we can check them.
Also, I would need to request temporary access (WP-Admin and FTP) temporary access (WP-Admin and FTP) Preferably to a test site where the problem has been replicated.
Your answer will be private, meaning only you and I can access it.
❌ Please back up your database and website ❌
✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical.
✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.
Thanks for your patience. Please check the following steps:
1- Go to JetEngine-> Post Types
2- Edit the Events post type
3- Disable the "Custom Meta Storage (Beta)" option
4- Update the Post Type
5- Edit an Event post in the default language
6- Make a minor edit and update it
7- Update the translation
I tried the above steps on the testing site. Please check this translated post and let me know if it works correctly. (hidden link)