This thread is resolved. Here is a description of the problem and solution.
Problem:
The client reported a bug in WPML version 4.7.6 where an error occurs when clicking the '+' button on a page with custom fields. The error message displayed is: 'Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array.' This issue was linked to the handling of XML configurations for serialized custom fields.
Solution:
We identified that the XML file for the custom forms was misconfigured. Specifically, the 'optinText' field was expected to directly provide a text value for translation, but it was actually stored inside an array. To resolve this, we adjusted the XML configuration to correctly map the 'optinText' field as follows:
<key name="optinText"><br /> <key name="*"></key><br /></key>
After modifying the XML and clearing any existing translation jobs for this form, the error was resolved, and the translation process proceeded without issues. We recommend the client to apply this XML configuration change and verify the results.
If this solution does not apply to your situation, or if it seems outdated, please check the related known issues and confirm that you have the latest versions of themes and plugins installed. If the problem persists, we highly recommend opening a new support ticket at WPML support forum.
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.
This topic contains 30 replies, has 0 voices.
Last updated by 1 week, 3 days ago.
Assisted by: Dražen.