Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was experiencing a fatal error on all products with a gallery after using the WPML plugin to translate from Polish to Czech and enabling media translation settings.

Solution:
1. We asked the client if the issue disappeared when filling all the custom fields (ACF) with test information.
2. We inquired whether these fields were set to be translatable, copied, or copied once.
3. We guided the client to check the configuration by going to Custom Fields -> Edit the Field group that contains these fields -> Edit the fields.
4. We provided a link to a guide for setting the correct configuration: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/
5. After consulting with colleagues, we concluded that WPML does not generate errors if ACFs are left empty in the original content, suggesting that the issue might be due to custom code or third-party plugin/theme functionality.

If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. We also 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 further assistance is needed, please contact us in the WPML support forum.

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 13 replies, has 2 voices.

Last updated by Carlos Rojas 1 year, 2 months ago.

Assisted by: Carlos Rojas.

Author Posts
March 11, 2024 at 10:35 am #15394173

jiriD-6

Hi, i used WPML plugin to translate from PL to CZ, all products was translated perfectly but i didnt saw a gallery. So I found a solution:

WPML > Settings > Media Translation , and check following boxes :

Translate existing media in all languages
Duplicate existing media for translated content
Duplicate the featured images for translated content

Next click on the start button. Please wait until it is done, next check the page.

Since then I get an error on all products that have a gallery.

Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in /www/doc/www.subzerowolf.cz/www/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php:282 Stack trace: #0 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php(60): WPML_Element_Translation->maybe_populate_cache(Array) #1 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(4595): WPML_Element_Translation->element_id_in(Array, 'cs') #2 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/sitepress-multilingual-cms/inc/template-functions.php(381): SitePress->get_object_id(Array, 'attachment', true, 'cs') #3 /www/doc/www.subzerowolf.cz/www/wp-includes/class-wp-hook.php(324): wpml_object_id_filter(Array, 'attachment', true) #4 /www/doc/www.subzerowolf.cz/www/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #5 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/acfml/classes/class-wpml-acf-attachments.php(29): apply_filters('wpml_object_id', Array, 'attachment', true) #6 /www/doc/www.subzerowolf.cz/www/wp-includes/class-wp-hook.php(326): WPML_ACF_Attachments->load_translated_attachment(Array) #7 /www/doc/www.subzerowolf.cz/www/wp-includes/plugin.php(256): WP_Hook->apply_filters(Array, Array) #8 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/advanced-custom-fields/includes/acf-hook-functions.php(109): apply_filters_ref_array('acf/load_value/...', Array) #9 /www/doc/www.subzerowolf.cz/www/wp-includes/class-wp-hook.php(324): _acf_apply_hook_variations(Array, 4182, Array) #10 /www/doc/www.subzerowolf.cz/www/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #11 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/advanced-custom-fields/includes/acf-value-functions.php(118): apply_filters('acf/load_value', Array, 4182, Array) #12 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/advanced-custom-fields/includes/api/api-template.php(453): acf_get_value(4182, Array) #13 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/acfml/classes/strategy/repeater-sync/PostHooks.php(39): get_field_objects(4182) #14 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(17): ACFML\Repeater\Sync\PostHooks->displayCheckbox('product', Object(WP_Post)) #15 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPML\FP\{closure}(Array) #16 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(257): WPML\FP\Right->map(Object(Closure)) #17 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Promise.php(24): WPML\FP\Right->chain(Object(Closure)) #18 /www/doc/www.subzerowolf.cz/www/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/Hooks.php(50): WPML\FP\Promise->resolve(Object(WPML\FP\Right)) #19 /www/doc/www.subzerowolf.cz/www/wp-includes/class-wp-hook.php(324): WPML\LIB\WP\Hooks::WPML\LIB\WP\{closure}('product', Object(WP_Post)) #20 /www/doc/www.subzerowolf.cz/www/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #21 /www/doc/www.subzerowolf.cz/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #22 /www/doc/www.subzerowolf.cz/www/wp-admin/includes/meta-boxes.php(1714): do_action('add_meta_boxes', 'product', Object(WP_Post)) #23 /www/doc/www.subzerowolf.cz/www/wp-admin/edit-form-advanced.php(271): register_and_do_post_meta_boxes(Object(WP_Post)) #24 /www/doc/www.subzerowolf.cz/www/wp-admin/post.php(206): require('/www/doc/www.su...') #25 {main} thrown in /www/doc/www.subzerowolf.cz/www/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 282

March 11, 2024 at 11:06 am #15394396

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello,
Thank you for contacting us

1.- I kindly ask you to follow the steps described by my colleague in this ticket: https://wpml.org/forums/topic/uncaught-typeerror-illegal-offset-type-in-isset-or-empty-in-3/

2.- Please increase the WP memory Limit. Minimum requirements are 128Mb: https://wpml.org/home/minimum-requirements/
You can add this to wp-config.php to increase WP memory:`

/* Memory Limit */
define('WP_MEMORY_LIMIT', '128M');

- Add it above the line /* That's all, stop editing! Happy blogging. */

You can double-check the WordPress memory limit in WPML -> Support

Regards,
Carlos

March 11, 2024 at 11:18 am #15394481

jiriD-6

I did all what you said and still got error 🙁

March 11, 2024 at 11:26 am #15394625

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,

1.- Please share a URL where the issue can be seen.

2.- I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to back up the site before providing us access. If we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

March 11, 2024 at 11:48 am #15394713

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Thank you for sharing this information.

1.- Before we continue I kindly ask you to create a full backup of the site and update the theme to the latest version: hidden link

2.- Also, please share the URL in the original language of the post where the issue appears.

March 11, 2024 at 11:56 am #15394767

jiriD-6

We got backup of site.

orignal product lang:
hidden link

error is in this product in CZ language variant (error is only in this variant, not in original)

March 11, 2024 at 11:57 am #15394769

jiriD-6

hidden link for example

March 11, 2024 at 12:11 pm #15394861

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

Does the issue disappears if you fill all the custom fields (with test information)?

March 11, 2024 at 12:20 pm #15394939

jiriD-6

yes issue disappears if i fill all custom field(ACL)

March 11, 2024 at 12:33 pm #15395096

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

COuld you tell me if these fields are set to be translatable, copied or copied once?

March 11, 2024 at 12:38 pm #15395106

jiriD-6

please can you navigate me where can i find it

March 11, 2024 at 12:45 pm #15395180

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Sure.

To see the configuration you can go to Custom Fields -> Edit the Field group that contains these fields -> Edit the fields and you will find the configuration.

I recommend you take a quick look at this guide where you will find the steps to set the correct configuration: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/

March 11, 2024 at 12:59 pm #15395248

jiriD-6

ACL - Same fields across languages

March 11, 2024 at 1:25 pm #15395589

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,

I consulted my colleagues about this issue and WPML won't generate any error if the ACFs are left empty in the original content regardless of the configuration. So everything points to a custom code or a functionality from a third-party plugin/theme that is causing this problem because is trying to display the content from ACF that doesn't exists.