Skip to content Skip to sidebar

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
- 7:00 – 12:00 7:00 – 12:00 7:00 – 12:00 7:00 – 12:00 7:00 – 12:00 -
- 13:00 – 16:00 13:00 – 16:00 13:00 – 16:00 13:00 – 16:00 13:00 – 16:00 -

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

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Nicolas V. 1 year, 6 months ago.

Assisted by: Nicolas V..

Author Posts
May 30, 2024 at 12:51 pm

shahryarT

Background of the issue:
I have been managing translations for an English language site into Dutch and German successfully. Recently, I added Swedish, Spanish, Finnish, and French translations. Initially, the translations appeared successful, but issues arose the following day with 500 errors on the Swedish, French, and Finnish pages. The media library also unexpectedly increased from 400-500 items to 1218 due to
errored duplicated media items, that are not actually images at all and have strange File URLs like:hidden link . Link to a page where the issue can be seen: hidden link

Symptoms:
The Swedish, French, and Finnish pages are showing 500 errors, which I traced back to a media error. These languages no longer have images assigned to ACF fields as expected. The media library contains many new media items that are not images, with strange file URLs, indicating a duplication issue. The automatic translation feature may have incorrectly tried to translate these media items, causing the errors.

Questions:
How can I restore the media library to its correct state?
How can I ensure media items are correctly assigned to the translated pages?

May 30, 2024 at 1:42 pm #15688327

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hello,

As discussed, could you please provide me with an admin access to your staging site where the issue has been replicated – so I can further investigate.

I will activate a private field for your next answer where you can provide that information safely (this field is only visible by you and the support team). Don't share your own admin account, create a new one that you will delete when we finish troubleshooting.

Don't forget to install WP File Manager to allow us to access your WP files and activate WP_DEBUG.

May 30, 2024 at 2:15 pm #15688462

shahryarT

Is there a way to add an additional email address for notifications to this ticket? I'm logged into my clients account to access support.

May 30, 2024 at 10:37 pm #15690244

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hello,

I spent quite some time on the site and couldn't find the root cause. I think it could be related to the fact that you are using a custom folder app/uploads (instead of /wp-content/uploads) for your medias.
But your staging copy doesn't give me access to most of your files (htaccess, wp-config.php or even wp-content), so I couldn't check this point.

What I ended up doing is deleting all those wrong image paths from your DB.
- Make a full backup of your database
- Open the wp_posts table
- Search For: "Anywhere" Like %% "/attachment/" and display 500 results per page
- Delete all 500 elements and repeat until delete everything
(see screenshot)

---

After that you can update your translations (simply open them and re-save them) page per page

---

Regarding the notifications, we can't add emails ourselves but you can add a user under your client's account with a "developer" role and open tickets with that new user.

screenshot-2024.05.30-17_35_33.png
May 31, 2024 at 8:23 am #15691048

shahryarT

Hi Nicolas,

Really appreciate your time on this.

If it was to do with the media directory wouldn't it be having this issue for all the languages though, not just half of them?

I can see the homepage for Sweden works now on staging which is great, and I managed to get another page to work by doing what you said and opening and resaving the translation.

Just a couple of questions:
1) Is there a way to automatically do that step? It's going to take quite a long time to do that manually.
2) Have you changed anything in ACF? When I went to update the translation it was asking for new translations of some of the ACF labels ('Add row' etc). While this probably isn't an issue overall, it's another step which is going to make this a slow process if I have to do that on every page.
3) Is there anything else you've changed on the website or WPML settings while working on this?

Thanks!

May 31, 2024 at 2:38 pm #15692994

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hello,

1) We don't have an automatic way to update translation but you can try the following:
- Use the quick edit option from WordPress in "Pages"
- Try to resend all pages to translation in "WPML > Translation Management"

2) Yes, I have updated ACFML (our add-on) to the latest version because the old version had a known issue with attachments. For more information read: https://wpml.org/errata/advanced-custom-fields-fatal-error-uncaught-typeerror-illegal-offset-type-in-isset-or-empty-in/

3) Apart from updated all our plugins to the latest version
- I added WP File Manager to access your files but as I mentioned they are not accessible on your staging version
- I added WP Adminer to get access to the DB but I would recommend you to do it from your serveur Cpanel for your production site

The topic ‘[Closed] Media duplication/translation issue’ is closed to new replies.