Skip to content Skip to sidebar

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.

100% of people find this useful.

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: 

This topic contains 30 replies, has 0 voices.

Last updated by Dražen 1 week, 3 days ago.

Assisted by: Dražen.

Author Posts
August 19, 2025 at 8:33 am #17330265

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

great,thank you and glad to hear that it helped. 🙂

I will be then closing this ticket now.

Kind regards,
Drazen