Home›Support›English Support›[Waiting for user confirmation] ❗ Fatal error when translating Visual Portfolio "Saved Layout" – strtr(): Argument #1 must be ...
[Waiting for user confirmation] ❗ Fatal error when translating Visual Portfolio "Saved Layout" – strtr(): Argument #1 must be ...
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.
Our wait time is higher than usual, please make sure you are meeting the minimum requirement - https://wpml.org/home/minimum-requirements before you report issues, and if you can take a look at current Known Issues - https://wpml.org/known-issues/. Thank you.
Background of the issue:
I am trying to translate a Saved Layout created with the Visual Portfolio plugin on my WordPress website. The error prevents me from accessing the WPML translation editor. Link to a page where the issue can be seen: hidden link
Symptoms:
PHP Fatal error: Uncaught TypeError: strtr(): Argument #1 ($string) must be of type string, array given in /wp-content/plugins/sitepress-multilingual-cms/classes/utilities/Labels.php on line 26. The issue happens when attempting to open the translation editor, likely due to a field or label that is not a plain string. I expected to see the Gallery Saved layout without Title H2, but instead, I got an H2 Title under the photos. The layout is not good.
Questions:
Why is WPML expecting a string but receiving an array?
How can I fix the fatal error to access the WPML translation editor?
This has been escalated to our Compatibility team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you.
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
The custom field `vp_images` was originally set to be translatable, but it should actually be set to "Copy". Since this field contains an array (not a single string), it caused the error: "must be of type string, array given."
Here’s how to fix it:
1. Go to WPML > Settings > Custom Fields.
2. Find `vp_images` and change its translation preference to Copy (or Copy once).
3. Navigate to WPML > Translation Management > Jobs, and trash the translation job that is currently in progress.
4. Go back to the original post/page, resave it, and then create a new translation.
This will ensure everything works properly without errors.