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?
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:
------------------------------- 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 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:
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.