Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you're experiencing a fatal error with translations related to ACF image fields, where an ID is returned instead of the expected image array, this might be similar to the issue discussed in the WPML forum thread: https://wpml.org/forums/topic/acf-galery-field-returns-array-in-main-language-and-id-in-secondary-language/.
Solution:
We recommend creating a staging site or a copy of your website for further investigation. This allows us to safely explore and resolve the issue without affecting your live site. If you need assistance creating a staging site, please consult your hosting provider. Remember to register WPML on the staging site as well. If providing a staging site is not possible, please inform us in your support ticket.

Please note that the solution might be outdated or not applicable to your specific 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 the issue persists, we encourage you 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: 

This topic contains 1 replies, has 2 voices.

Last updated by Andreas W. 1 year, 2 months ago.

Assisted by: Andreas W..

Author Posts
May 15, 2024 at 7:34 pm #15632155

Justin Channell

we're having an issue with our translations casuing a fatal error. This seems to come from ACF image fields. The image fields are currently being output like this:

">

Our PHP error log is showing:
PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string

May 16, 2024 at 7:19 am #15633173

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I would like to offer to have a closer look at the problem and request temporary access (wp-admin and FTP) to the website to investigate this issue further.

You can find the required fields below the comment section when you log in to leave the next reply. The information you provide is private, which means only you and I can see and access it.

IMPORTANT
Please be sure to make a backup copy of the website and database before allowing us access.
If you can't see the wp-admin / FTP fields, your post and website credentials are set as PUBLIC. DO NOT publish the data unless you see the required wp-admin / FTP fields.

I may have to install a plugin called "All In One WP Migration" to make a copy of the website where I can investigate the issue further.

However, I would also be very grateful if you could provide a staging site or copy of the website from your server yourself for this purpose.

If you have any questions about creating such a staging site, you can consult your hosting provider. Just take note that WPML should be registered on this site again.

If you are unable to provide such a copy of the site for testing, please let me know on this ticket.

The private response form looks like this:
hidden link

Next time you reply, click "I still need assistance."

Video:
hidden link

Please note that we are obliged to request this information individually on each ticket. We may not access any access information not specifically submitted on this ticket in the private response form.

Best regards
Andreas

May 16, 2024 at 8:20 am #15633625

Justin Channell

Hi Andreas,

Thanks for you feedback. After some more debugging, we found a thread that was related to our issue (https://wpml.org/forums/topic/acf-galery-field-returns-array-in-main-language-and-id-in-secondary-language/)

We were getting the same thing where an ID was coming back instead of the image array (as defined in ACF). After manually updating each of the "Product" posts (custom post type) it seems to have fixed the issue and it's now returning the image array.

Not sure if this is something that needs to be investigated as part of the automatic translations, or if this is a once-off/specific issue.

Thanks again