Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 1 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 12 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
July 31, 2023 at 9:20 am

frankB-3

A client of ours has a website which we are updating for performance issues. We've rearranged the order in which scripts are loaded and are upgrading the php version from 7.4 to 8.1.

W've set up a identical /staging environment to make the changes which all seem to work well. When we apply the changes to the site .com and change the php version to 8.1 we get a fatal error (only in the french language). This error showed itself earlier only in polish, but this somehow changed.

I don't understand why this is only showing itself on the live environment which is functionally identical after the updates are applied.

Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in /home//public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php:259 Stack trace: #0 /home//public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php(60): WPML_Element_Translation->maybe_populate_cache(Array) #1 /home//public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(4575): WPML_Element_Translation->element_id_in(Array, 'fr') #2 /home//public_html/wp-content/plugins/sitepress-multilingual-cms/inc/template-functions.php(381): SitePress->get_object_id(Array, 'attachment', true, 'fr') #3 /home//public_html/wp-includes/class-wp-hook.php(308): wpml_object_id_filter(Array, 'attachment', true) #4 /home//public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #5 /home//public_html/wp-content/plugins/acfml/classes/class-wpml-acf-attachments.php(29): apply_filters('wpml_object_id', Array, 'attachment', true) #6 /home//public_html/wp-includes/class-wp-hook.php(310): WPML_ACF_Attachments->load_translated_attachment(Array) #7 /home//public_html/wp-includes/plugin.php(256): WP_Hook->apply_filters(Array, Array) #8 /home//public_html/wp-content/plugins/advanced-custom-fields-pro/includes/acf-hook-functions.php(109): apply_filters_ref_array('acf/load_value/...', Array) #9 /home//public_html/wp-includes/class-wp-hook.php(308): _acf_apply_hook_variations(Array, 4931, Array) #10 /home/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #11 /home//public_html/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php(118): apply_filters('acf/load_value', Array, 4931, Array) #12 /home//public_html/wp-content/plugins/advanced-custom-fields-pro/includes/api/api-template.php(45): acf_get_value(4931, Array) #13 /home//public_html/wp-content/themes/smeders/includes/controllers/frontpage.php(105): get_field('project_gallery') #14 /home//public_html/wp-content/themes/smeders/core/twig.php(18): load_frontpage_vars(Array) #15 /home//public_html/wp-content/themes/smeders/core/route.php(5): handle_twig(Array, 'front-page.twig', Array, 'echo') #16 /home//public_html/wp-content/themes/smeders/includes/web/routes.php(32): route(true, 'front-page.twig', 'load_frontpage_...') #17 /home//public_html/wp-content/themes/smeders/index.php(5): require('/home/hollandaq...') #18 /home/public_html/wp-includes/template-loader.php(106): include('/home/hollandaq...') #19 /home//public_html/wp-blog-header.php(19): require_once('/home/hollandaq...') #20 /home//public_html/index.php(17): require('/home/hollandaq...') #21 {main} thrown in /home//public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 259

July 31, 2023 at 9:57 am
August 1, 2023 at 7:44 am #14130977

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Frank,

I am assigned this ticket and 'll try my best to further assist you on the matter.

I understand that the said issue is happening only when you switch to PHP 8.1 in the live/production site, while this issue doesn't happen on the identical staging site.

I see currently the live site is running on PHP 7.4.

To escalate the matter to our 2nd tier, I'll need some permissions and information from you, please consider followings:

1) Can you please write some steps that when exactly this error is thrown? Like doing some particular operation (i.e. updating a post or product or etc). Or it happens as soon as you switch to PHP 8.1?

2) Can you provide a duplicator package of the site? So we can try this in another environment with the said PHP version(s). Please see https://wpml.org/faq/provide-supporters-copy-site/ for more details.

3) If #2 isn't possible or perhaps doesn't help in another environment, is this OK to access the site and database in your live environment and try our fixes there? For this, we 'll also need to install a plugin to access and check the database (like mentioned in the chat).

IMPORTANT: For any of the above, please make sure to have a full backup of site and database beforehand!!

I've set your next reply as private to share this information safely.

Regards.

The topic ‘[Closed] Uncaught TypeError: Illegal offset type in isset or empty in’ is closed to new replies.