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.

Sun Mon Tue Wed Thu Fri Sat
12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 - -
- - - - - - -

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

This topic contains 4 replies, has 2 voices.

Last updated by Noman 1 year, 5 months ago.

Assisted by: Noman.

Author Posts
December 7, 2023 at 2:57 pm #15017963

pauli-7

We have a critical error with our website if we run php 8.2 but we do not if it runs PHP 7.4.

December 7, 2023 at 5:41 pm #15020023

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

I have created a fresh WP site with PHP v8.2 and installed the WPML and ACF plugins. Can you please try to replicate the issue and let me know the step-by-step instructions on how you have replicated that issue so that I can let our 2nd tier know about it?

Please note that you don't need to set up an entire website or clone your existing site. You can see more details here: https://wpml.org/faq/how-to-reproduce-issues-and-share-them-with-wpml-support/

I’m going to send the fresh WP site login details in my next private reply.

Thank you

December 10, 2023 at 2:08 pm #15031305

pauli-7

Hello,

Thank you, I-ve been using your fresh WP install with all the right plugins and also a repeater structure used in original website.
In the fresh WP install the ACFML Sync. checkbox works fine and when post update button is clicked, no critical error occurs.

So, here is what I did in the original site where the critical problem still appears.
* I've disactivated all the plugins to have the same plugins and version than in the fresh WP install.
* I've selected a default template (Twenty twenty-four) and the critical error is still there.

I went into the error log and checked where in the code this error happens:

"PHP Fatal error: Uncaught Error: Cannot assign an empty string to a string offset in /nas/content/live/tigercatco1dev/wp-content/plugins/acfml/classes/strategy/repeater-sync/CheckboxHooks.php:46#012Stack trace:#012#0"

Within your fresh install I've inserted a debug code starting line 42 in file CheckboxHooks.php and function storeSynchroniseOption:

$synchroniseOption = CheckboxOption::get();

// PRINT LOG ---------------------------
$file = dirname(__FILE__).'https://cdn.wpml.org/log_synch.txt';
$log = '$trid / $synchroniseOption 1: '.$trid.' *** '.print_r($synchroniseOption,true)."\n\r";
file_put_contents($file, $log, FILE_APPEND);
// PRINT LOG --------------------------- */

------------------------------- Here is the result in the fresh WP install:
* Checkbox ACFML Sync unselected in the post
$trid / $synchroniseOption: 18 *** Array
(
[18] =>
)

* Checkbox ACFML Sync unselected in the post
$trid / $synchroniseOption: 18 *** Array
(
[18] => 1
)

------------------------------- Here is the result in original WP install:
* To unselect Checkbox ACFML Sync and update post triggers critical error!!!
There's no array as a result of "$synchroniseOption = CheckboxOption::get();"
And it seems not empty either???

$trid / $synchroniseOption: 173887 ***

What is strange is that if I forced ONCE to created an array to make sure it exist prior to trigger a critical error:
$synchroniseOption[$trid] = '';

Then all post works fine even after removing this forced array creation!!!
Just like if something was missing to create it in the first place.

------------------------------ Here is the full error JSON:
{
"installName": "tigercatco1dev",
"environment": "DEV",
"type": "error",
"date": "2023-12-10T12:52:45.877Z",
"severity": null,
"client": null,
"message": "PHP Fatal error: Uncaught Error: Cannot assign an empty string to a string offset in /nas/content/live/tigercatco1dev/wp-content/plugins/acfml/classes/strategy/repeater-sync/CheckboxHooks.php:46#012Stack trace:#012#0 /nas/content/live/tigercatco1dev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(17): ACFML\\Repeater\\Sync\\CheckboxHooks->storeSynchroniseOption(50304)#012#1 /nas/content/live/tigercatco1dev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPML\\FP\\{closure}(Array)#012#2 /nas/content/live/tigercatco1dev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(257): WPML\\FP\\Right->map(Object(Closure))#012#3 /nas/content/live/tigercatco1dev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Promise.php(24): WPML\\FP\\Right->chain(Object(Closure))#012#4 /nas/content/live/tigercatco1dev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/Hooks.php(50): WPML\\FP\\Promise->resolve(Object(WPML\\FP\\Right))#012#5 /nas/content/live/tigercatco1dev/wp-includes/class-wp-hook.php(324): WPML\\LIB\\WP\\Hooks::WPML\\LIB\\WP\\{closure}(50304)#012#6 /nas/content/live/tigercatco1dev/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)#012#7 /nas/content/live/tigercatco1dev/wp-includes/plugin.php(517): WP_Hook->do_action(Array)#012#8 /nas/content/live/tigercatco1dev/wp-content/plugins/advanced-custom-fields-pro/includes/acf-form-functions.php(143): do_action('acf/save_post', 50304)#012#9 /nas/content/live/tigercatco1dev/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-post.php(328): acf_save_post(50304)#012#10 /nas/content/live/tigercatco1dev/wp-includes/class-wp-hook.php(326): ACF_Form_Post->save_post(50304, Object(WP_Post))#012#11 /nas/content/live/tigercatco1dev/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)#012#12 /nas/content/live/tigercatco1dev/wp-includes/plugin.php(517): WP_Hook->do_action(Array)#012#13 /nas/content/live/tigercatco1dev/wp-includes/post.php(4760): do_action('save_post', 50304, Object(WP_Post), true)#012#14 /nas/content/live/tigercatco1dev/wp-includes/post.php(4862): wp_insert_post(Array, false, true)#012#15 /nas/content/live/tigercatco1dev/wp-admin/includes/post.php(453): wp_update_post(Array)#012#16 /nas/content/live/tigercatco1dev/wp-admin/post.php(227): edit_post()#012#17 {main}#012 thrown in /nas/content/live/tigercatco1dev/wp-content/plugins/acfml/classes/strategy/repeater-sync/CheckboxHooks.php on line 46",
"uuid": "b2ad3158-6f32-4ba2-8352-1b9c58358dc3"
}

------------------------------------------------------------

I do not know if it helps but that's were I am.

Thank you for your help.

JM

December 11, 2023 at 2:49 pm #15038723

pauli-7

Hello,
Just to make sure thread is still active...
Waiting answer.

thank you.

JM duchi

December 11, 2023 at 3:31 pm #15039053

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

I really appreciate your patience regarding this and all the help you put in with the troubleshooting you did yourself. So, it’s your site specific issue and we can’t replicate it at a fresh WP site.

Could you please try to follow the below steps and let me know how it goes:

1. Please make sure the minimum requirements for WPML are met:
https://wpml.org/home/minimum-requirements/

2. Please make sure you are using the latest version of the theme and plugins on your site.

3. Please create a new post/page and try to check/uncheck the “Keep repeater and flexible sub-fields in the same order as the default language.” checkbox and see if this arises only on the existing post or the new post also have same issue.

4. If the issue still persists, please add the debug report in the Debug Information box. I have also enabled debug info box for your next reply: https://wpml.org/faq/provide-debug-information-faster-sup

Thank you

The topic ‘[Closed] PHP Fatal error: Uncaught Error: Cannot assign an empty string to a string offset’ is closed to new replies.