Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 4 replies, has 0 voices.

Last updated by Boris 1 day, 1 hour ago.

Assisted by: Andreas W..

Author Posts
January 2, 2025 at 3:46 pm #16559406

Boris

Background of the issue:
I am trying to re-open a support ticket for a site under development. The ticket was related to an issue with WPML Media Translation where all images disappeared from translations.

Symptoms:
The ticket was closed without notification, and I did not receive any message about the update.

Questions:
Can you please re-open this ticket: https://wpml.org/forums/topic/after-setting-up-wpml-media-translation-all-images-diseappeared-from-translations/

January 2, 2025 at 5:21 pm #16559618

Andreas W.
Supporter

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

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

Hello,

It looks as if the affected images use a custom ACF field coming from the following addon:
hidden link

Take note, that this plugin's last update about one year ago and it has not been tested with the three latest major updates of WordPress:
https://wordpress.org/plugins/acf-image-aspect-ratio-crop/

Take note, that we can not take responsibily for plugins that might not longer be maintained and it is the responsibility of the author for making such addon compatible with WordPress and WPML or other plguins.

I will try to recreate the issue now on a test site and see if I can figure out what is causing the issue.

Best regards
Andreas

January 2, 2025 at 5:47 pm #16559651

Andreas W.
Supporter

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

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

So far, I can not confirm any issue on my test site.

One-Click-Login:
hidden link

Could you please try to recreate the issue on this test site by using the same settings and display method as used on your site?

January 3, 2025 at 8:46 am #16560451

Boris

Hi Andreas,
that would be a lot of work, it's a very complexe website. I have set up a staging version of the site just for this troubleshooting. Can you use that? The credentials are in the other ticket I requested to be re-opened.

January 3, 2025 at 9:23 am #16560587

Boris

What I see on the staging site in a rental CPT English translation is this critical error. Might this have something to do with it?

Fatal error: Uncaught TypeError: Cannot access offset of type array in isset or empty in
/home/forge/domain.com/public/protostar/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-flexible-content.php:727 Stack trace: #0 /home/forge/domain.com/public/protostar/wp-includes/class-wp-hook.php(324): acf_field_flexible_content->load_value()
#1 /home/forge/domain.com/public/protostar/wp-includes/plugin.php(256): WP_Hook->apply_filters()
#2 /home/forge/domain.com/public/protostar/wp-content/plugins/advanced-custom-fields-pro/includes/acf-hook-functions.php(109): apply_filters_ref_array()
#3 /home/forge/domain.com/public/protostar/wp-includes/class-wp-hook.php(324): _acf_apply_hook_variations()
#4 /home/forge/domain.com/public/protostar/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#5 /home/forge/domain.com/public/protostar/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php(118): apply_filters()
#6 /home/forge/domain.com/public/protostar/wp-content/plugins/advanced-custom-fields-pro/includes/acf-field-functions.php(610): acf_get_value()
#7 /home/forge/domain.com/public/protostar/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-post.php(223): acf_render_fields()
#8 /home/forge/domain.com/public/protostar/wp-admin/includes/template.php(1456): ACF_Form_Post->render_meta_box()
#9 /home/forge/domain.com/public/protostar/wp-admin/edit-form-advanced.php(722): do_meta_boxes()
#10 /home/forge/domain.com/public/protostar/wp-admin/post.php(206): require('...')
#11 {main} thrown in /home/forge/domain.com/public/protostar/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-flexible-content.php on line 727

January 3, 2025 at 2:02 pm #16561591

Andreas W.
Supporter

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

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

Please make use of the private reply form and provide me admin access to the staging site for running further tests.

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

IMPORTANT
Please make sure you back up the website and database before granting us access.

If you cannot see the "wp-admin / FTP" fields, your post and website login details will be set to "PUBLIC". DO NOT publish the data unless you see the required wp-admin / FTP fields.

The private reply form looks like this:
hidden link

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

Video:
hidden link

Please note that we are required to request this information individually on each ticket. We are not allowed to access access information that was not specifically submitted on this ticket in the private reply form.

January 3, 2025 at 3:44 pm #16561953

Andreas W.
Supporter

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

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

There are various updates available on your site (theme, plugins).

Could you please make sure to run those updates and confirm if the issue persists before we continue testing?

Also, you will need to enable ACF PRO on the site. I am not able to review and edit the fields without having a active ACF PRO licence.

January 3, 2025 at 4:19 pm #16562033

Boris

Hi Andreas,
sorry about that. I've registered and updated everything.

January 3, 2025 at 5:37 pm #16562298

Andreas W.
Supporter

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

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

I imported your CPT and the ACF Field Groups to my sandbox but I still can not confirm the same issue here.

I can see the error on your site when trying to edit a translated CPT on the WordPress Editor, too.

I would like to take a local copy of your site for further testing, if you agree?

January 4, 2025 at 1:24 am #16562726

Andreas W.
Supporter

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

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

The reason for the error appears to be that a Flexible Content Field in ACF was set to "Translate" and you then corrupted the data on your translated CPTs.

The Flexible Content Field should always be set to "Copy once" when translating with the WordPress Editor.

I suggest you set the ACF Field Groups that are used on your CPTs to "Different fields across languages".

This is the recommended setting for translations made with the WordPress Editor and you will notneed to configure each field individually.

The only way I yet found to solve the issue at this moment would be to delete the translated CPTs and translate them again. If this is not an acceptable solution for you, the only way to solve the issue would be to investigate the wp_posts and wp_postmeta database tables and figure out which field's translations are causing the errors.

The issue does not occur on newly created CPTs if you use the recommended setting for the field groups.

January 4, 2025 at 10:50 am #16563126

Boris

Yes, by all means - you can make a local copy.

Regarding your findings: I cannot ask my client to re-translate all rentals. That would take them a week of work.

I will see if I can find anything in the database regarding the errors. Perhaps I can solve it that way.

But the main issue is not with the error, the issue is with the media not showing on the translated pages/rentals. Please focus on that.

Thanks for your help so far!

January 4, 2025 at 9:07 pm #16563831

Andreas W.
Supporter

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

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

My apologies, but as the translated data got corrupted I did not yet find a better solution.

The issues seems to be related to the "Flexible Content" fields. As there are many groups invovled it is very hard to figure out what went wrong. The issue could even be related to a field that is part of a Flexible Content. I realized that quiet many fields that should have been set to "Copy once" where set to "Translate".

WPML saves all translations on wp_posts and wp_postmeta.

I would suggest checking for the IDs of those fields on wp-postmeta and making sure that all translated entries use the same value as the original field's entries.

---

About the media:

IMPORTANT:
Could it be that the missing images on your site are coming from the fields Media > Slideshow and Media > Galerij?

The issue might be, that you are using here arrays with IDs and the media attachements in a second language would use a different ID.

---

About the local copy:

Sadly the local copy that I took from your site is not working as expected. If I create a new post the images do not even show up on the original content.

All translated posts are falling back to a a different template as well.

January 6, 2025 at 8:18 am #16565270

Boris

Hi Andreas,
no need to apologize, I know you guys always make extra effort to provide great support, which is very much appreciated!

As for the media:
- the issue is with the featured image and banner image as well, which are added through ACF fields using the "Advanced Custom Fields: Image Aspect Ratio Crop" plugin. Which apparently is not WPML-compatible, which Bruno Kos already noticed in the ticket I requested to be re-opened:
https://wpml.org/forums/topic/after-setting-up-wpml-media-translation-all-images-diseappeared-from-translations/

He asked me to clarify some things about those fields, to help him find the best way to address this issue. I don't know what he wanted to know about it, that's why I requested the ticket be re-opened.