This thread is resolved. Here is a description of the problem and solution.
Problem:
If you're experiencing a PHP fatal error in your WordPress admin when editing content that uses ACF Pro Flexible Content fields, particularly after updating the ACF Pro plugin, this might be due to ACFML interacting with ACF fields. The error typically occurs during Flexible Content value loading and is more prevalent in translated languages than in the original language.
Solution:
We recommend checking the WPML translation settings for your ACF field groups. Specifically, ensure that fields such as Relationship or Group fields are set to 'Copy' or 'Copy Once' instead of 'Translate'. Incorrect settings can lead to inconsistencies and errors across different languages. You can find the recommended settings on our documentation page: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/recommended-custom-fields-translation-preferences-for-acf-and-wpml/.
After adjusting these settings, try making a small change on the German Options page and save it, then save the secondary language options pages. If the problem persists, it might be due to a more complex issue such as leftover data from a Flexible Content field that no longer exists.
Please note that this solution might become irrelevant due to updates or specific configurations in your setup. If these steps do not resolve your issue, or if you find the information outdated, 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 necessary, feel free to open a new support ticket at WPML support forum for further assistance.
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: Exception
This topic contains 12 replies, has 0 voices.
Last updated by Dražen 2 months, 1 week ago.
Assisted by: Dražen.
| Author | Posts |
|---|---|
| March 10, 2026 at 12:08 pm #17885224 | |
|
Philip |
Hello WPML Support Team, I am contacting you regarding an issue that appears to occur when ACF Pro Flexible Content fields are used together with ACFML / WPML translations. ACF support suggested that we reach out to you to get your perspective on the issue, as it only occurs when translations are involved. Problem: After updating the ACF Pro plugin, our WordPress admin starts throwing a fatal PHP error when editing content that uses Flexible Content fields. Error message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type array in isset or empty The stack trace shows the issue happening while ACFML is interacting with ACF fields: `wp-content/plugins/acfml/classes/strategy/repeater-shuffle/OptionsPage.php` ### Observations 1. The issue **does not appear in the original language (DE)**. ### Temporary workaround We currently resolve the issue by patching the ACF plugin file: `pro/fields/class-acf-field-flexible-content.php` Example change: Original code ```php Patched version ```php We applied similar checks in several nearby places. After this patch: * the fatal error disappears However, the fix is overwritten after every plugin update. Question: Before escalating this further with ACF developers, we would like to understand whether this behavior might be caused by how ACFML passes layout metadata to ACF. Specifically: 1. Could `$l` become an **array instead of a layout key** in certain translation scenarios? ACF support mentioned that if the issue cannot be explained from the WPML side, they will escalate it to their developers. Any guidance would be greatly appreciated. |
| March 10, 2026 at 12:16 pm #17885306 | |
|
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, lest continue here in ticket. Please check if issue still happens after updating to latest WPML plugins and ACFML. Go to Plugins > Add New > Commercial > Click “Check for updates” and update WPML plugins to latest versions. Please make sure to create a backup, before doing any actions, just in case. Regards, |
| March 10, 2026 at 7:35 pm #17887015 | |
|
Philip |
Hi Dražen, Thank you for your reply. I updated **WPML and ACFML to the latest versions**, but unfortunately the issue still occurs. The fatal error remains the same: `PHP Fatal error: Cannot access offset of type array in isset or empty What is interesting is that the stack trace clearly shows **ACFML classes involved** right before the crash: `wp-content/plugins/acfml/classes/strategy/repeater-shuffle/OptionsPage.php` This only happens in **translated languages** (not in the original DE language). As a temporary workaround we patched the ACF file: `pro/fields/class-acf-field-flexible-content.php` Example change: Original Patched After this change the fatal error disappears and everything works normally. ACF support suggested contacting WPML first to understand whether ACFML could be passing an unexpected value (array instead of layout key) into ACF Flexible Content processing. Thank you! |
| March 11, 2026 at 6:28 am #17887487 | |
|
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, Thank you for the detailed information and for taking the time to investigate this. In order to move forward and properly escalate the issue to our developers, we would first need to confirm and reproduce the problem in a controlled environment. Could you please try to reproduce the issue on our test site? - hidden link Alternatively, if possible, please provide access to a staging site where we can safely perform debugging. This will allow us to verify whether the issue is directly related to WPML/ACFML and reproduce it so it can be escalated to our development team if necessary. I think issue could also be due to some leftovers in 2nd language if you have experimenting with ACF field group translation and setting them to translatable or similar, which is not recommended. Thank you for sharing the temporary patch. While modifying plugin core files is not something we can officially recommend, it is helpful for us to see where the issue may originate. Please let me know. Kind regards, |
| March 12, 2026 at 6:33 am #17890828 | |
|
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, Thank you. Would it be possible to check if the issue can be reproduced with a default WordPress theme (for example Twenty Twenty-Four) and only the WPML plugins together with ACF active? At the moment your site uses a custom-coded theme as well as several third-party or custom plugins, so it is difficult for us to confirm whether the issue is coming from WPML itself or from an interaction with other code. If it is okay with you, I could also myself temporarily disable the other plugins and switch to a default theme to try to reproduce the issue on your site. Please let me know if that is okay. Regards, |
| March 12, 2026 at 8:29 am #17891192 | |
|
Philip |
Hello Dražen, Thank you for your reply. Just to confirm — were you able to reproduce or at least see the actual error on our environment? I was able to see it before passing environment to you. And yes, that is absolutely fine. You can temporarily switch to a default theme and enable/disable plugins as needed in order to investigate the issue. Please feel free to proceed. |
| March 12, 2026 at 10:59 am #17891894 | |
|
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, Thank you for confirming and for allowing us to proceed with testing. Yes, I was able to see the error on your environment. From the initial checks, it appears that the issue may be related to leftover data from a Flexible Content field that no longer exists. Even though the field is not currently present in the Options Page field group, some related metadata still seems to be stored and is being processed when WPML/ACFML loads the fields. Because of this, I have escalated the case to our 2nd tier team so they can review it further and advise on the best way to resolve it safely. I will update you as soon as I receive feedback from them. Kind regards, |
| March 13, 2026 at 12:27 pm #17895502 | |
|
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, Thank you for your patience while we reviewed this further with our 2nd tier team. After checking the configuration, we noticed that several fields in your ACF field groups appear to have incorrect WPML translation settings. In particular, fields such as Relationship or Group fields are currently set to Translate, while these field types should normally be configured as Copy or Copy Once when used together with WPML. When such fields are set to Translate, it can lead to inconsistencies between languages and may cause the type of problems you are experiencing. Since you are using Expert mode, it is important to carefully review all ACF field groups and verify that the translation preference for each field is configured correctly. At the moment it seems that some of these settings are not aligned with the recommended configuration. You can review the recommended settings in our documentation here: We suggest the following steps: - Review the translation preferences for all fields in your ACF field groups and adjust them according to the recommendations in the documentation. - After correcting the settings, open the German Options page, make a small change, and save it again. Then try saving the secondary language options pages. Please let us know how it goes after trying the above steps. Regards, |
| March 13, 2026 at 12:57 pm #17895557 | |
|
Philip |
Hello Drazen, Thank you for checking this with the 2nd tier team. We will review the translation preferences of all ACF fields and try to adjust them. However, I would like to clarify one important point. Even if the translation preferences are configured incorrectly, this should normally not result in a PHP fatal error, right? In our case the error occurs inside: acf-field-flexible-content.php:572 with the message: Cannot access offset of type array in isset or empty This suggests that ACFML receives an unexpected data structure when loading the Flexible Content field. We have already spent a time investigating this issue on our side, including manually correcting affected data, preparing a dedicated environment for debugging, and providing access for your team. Because of that, we were hoping that the investigation could help identify the exact root cause of the fatal error rather than focusing only on general configuration recommendations... Could you please confirm whether this situation has been reported before or if it might indicate a bug in ACFML when Flexible Content fields contain nested fields with incorrect translation preferences? We will try to proceed with adjusting the field settings. Thank you for your help. |
| March 15, 2026 at 3:52 pm #17898343 | |
|
Philip |
Hello Dražen, Following your suggestion, we tried to reproduce the issue after adjusting the ACF translation settings. To eliminate the possibility that this is caused by incorrect configuration in existing field groups, we also tried to create a new ACF field group specifically for the Events CPT and configured the translation preference as Copy, according to the documentation. Reproduction steps: - Create a new ACF field group for the Events CPT with translation preference set to Copy: hidden link - Open an Event in German (DE) and save a value in the field: hidden link - Switch to the French (FR) translation: hidden link - The value is correctly copied from DE to FR: hidden link - Click Update on the FR version: hidden link - At this point the system returns the same error: hidden link This suggests that the issue is not related to incorrect translation preferences in the existing field groups, since it occurs even with a newly created group configured according to the recommended settings. As mentioned earlier, the fatal error occurs in: acf-field-flexible-content.php:572 with the message: Cannot access offset of type array in isset or empty From the behavior it looks like ACFML receives an unexpected data structure when saving the translated Flexible Content field, even when the translation preference is set to Copy. Please let me know. |
| March 16, 2026 at 6:30 am #17898732 | |
|
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, Thank you for taking the time to investigate this further and for sharing the detailed steps and findings. I will now share this information with our 2nd tier team so they can review it and advise further. I will get back to you as soon as I have an update. Kind regards, |
| March 30, 2026 at 5:01 pm #17937682 | |
|
Philip |
Hi Drazen, Do you still need our staging environment for debugging, or can we take it back? I assume you might also need it for the second ticket: Please let me know. |
| March 31, 2026 at 5:43 am #17938258 | |
|
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, thanks, no need anymore. Both issues are in preparation for fixes release in a new ACFML version, so I think we are good. Regards, |
