Home›Support›English Support›[Resolved] PHP Fatal error when saving an options page in some WPML languages
[Resolved] PHP Fatal error when saving an options page in some WPML languages
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing a PHP fatal error when trying to save an options page in Polish and German languages using WPML and ACF Pro. The error message indicates an issue with illegal offset type in isset or empty, which is not directly caused by ACF but by how WPML interacts with ACF's low-level filters. Solution: We have identified that removing the options
options_nl_groep_voor_sociallinks
and
options_pl_groep_voor_sociallinks
from the
wp_options
table resolves the issue. It is crucial to back up the database before proceeding with this solution to prevent any data loss. This action should stop the fatal error from occurring when updating the options pages in the affected languages.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, 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 problems persist, please 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.
Background of the issue:
I am trying to save an options page. The site uses WPML in 5 languages, with the default being English. The issue only seems to persist when saving in Polish and German. The error I get is this: PHP Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in /data/sites/web/vanhavermaetbe/subsites/international.vanhavermaet.be/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-flexible-content.php:726 but I don't think it is caused by a mistake in ACF's code. I already contacted ACF support, this is their response: "Please reach out to WPML for help with this. The issue is caused by them using ACF's low level filters to modify the data being sent into ACF, in theory for each language - but they're sending malformed data in some cases so ACF generates an error. We wouldn't want to fix this our side, because this error is likely preventing data loss by informing you something went wrong when initialising your data - and it would only be generated for developers using our low level functions for custom functionality." Here is a forum with the exact same issue: https://wpml.org/forums/topic/get-fatal-error-when-updating-options-page/ Here it says to revert PHP version to 7.4. In my case I can't revert to PHP 7.4 for obvious security reasons. This forum also states that the bug was reported to the dev team, are there any updates regarding this bug?
Symptoms:
A PHP fatal error occurs when saving an options page in Polish and German languages.
Questions:
Are there any updates regarding the bug reported in the forum?
Is there a workaround for this issue without reverting to PHP 7.4?
As I mentioned, I'm consulting our second-tier supporters and developers about this issue. Meanwhile, we are also waiting for access to your staging site where the problem occurs.
If you need further help with this, please share the access details to your site with me.
I'm enabling a private message for the following reply.
Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ **IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--
As an alternative to letting us have access to a staging site, we want to ask for your help replicating this issue. For this, I created a test website with a clean WordPress install. You can access it through this link:
hidden link
With this link, you'll be directly logged in.
I already installed ACF Pro and WPML + its add-ons.
Please configure WPML and ACF as set on your site (just the basic configurations needed to replicate the issue are enough).
Please let us know when everything is finished, and you can replicate the problem.
Important! Do not import your site to the test site. We must replicate the problem on a fresh, clean WordPress installation.
I need to escalate this case to our second-tier supporters. To do so, I need to take a copy of your site and install a plugin like Duplicator or All In One Migration.
Thanks for the follow up and sorry for the late reply.
You guys have my approval to install any plugin you need!
You can also disable plugins if necessary.
If you need to change the wp-config.php to raise the memory limit for example, feel free!
Regarding the Privacy options page, these fields are programmatically added by our custom 'expliciet-privacy' plugin. But nevertheless the error persists on other options pages as well.
Our second-tier supporter has debugged this issue and found that removing the options options_nl_groep_voor_sociallinks and options_pl_groep_voor_sociallinks from the wp_options fixes this problem. The fatal error would not reappear when you update the options pages in German and Polish.
**** Important! backup the DB before you proceed with those steps****
Wow, that did the trick!
I can now update my options without any issues.
I'm curious to know how your second-tier supporter even found this.
Because there are thousands of tables in the wp_options table.
I wouldn't even know how to debug this.
If you're helpdesk is busy you can ignore this, i'm just a bit curious :p
Thank you for the help Itamar and also send my gratitude to that awesome developer!