Skip Navigation

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

Problem:
The client is experiencing an issue where images disappear and custom fields for images cannot be edited after installing WPML Media to translate image captions for posted articles.
Solution:
We identified a similar issue documented at https://wpml.org/errata/advanced-custom-fields-fatal-error-uncaught-typeerror-illegal-offset-type-in-isset-or-empty-in/, but the symptoms did not match exactly. Therefore, we reverted the workaround applied and suggested the client to edit the file

/wp-content/plugins/acfml/classes/class-wpml-acf-attachments.php

, around line 28. We instructed to replace the workaround code with the default code.

foreach ( $attachments as $key => $attachment_id ) {
        $translated_attachments[ $key ] = apply_filters( 'wpml_object_id', $attachment_id, 'attachment', true );

If you're experiencing this issue, we recommend trying the steps above. However, the solution might be irrelevant due to it being outdated or not applicable to your 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 problem persists, please open a new support ticket at our support forum.

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 9 replies, has 2 voices.

Last updated by Long Nguyen 9 months ago.

Assisted by: Long Nguyen.

Author Posts
March 28, 2024 at 12:28 pm #15460542

yusukeI-2

We are using WPML in the production of our corporate website, which will go live tomorrow.
I just installed "WPML Media" to translate image captions for posted articles,
I am getting an error where images disappear and custom fields for images cannot be edited.
Is there a possible solution?

March 28, 2024 at 1:50 pm #15461037

yusukeI-2

I am waiting for support as I have not resolved it yet.

March 28, 2024 at 2:26 pm #15461193

yusukeI-2

I am waiting to hear from support, when will I hear from you?

March 28, 2024 at 4:19 pm #15461687

yusukeI-2

We are planning to work on the release today, but since the problem has not been resolved, we have taken another emergency action.
We would like to resolve this issue as soon as possible after the release, so please contact us as soon as possible.

March 29, 2024 at 4:33 am #15463024

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Yusuke,

Thank you for contacting WPML support, I’m happy to help you with this issue.

I understand the issue here is the images in the ACF gallery field disappeared after installing WPML Media Translation plugin. However, even after deactivating WPML Media, the image still doesn't display in the frontend.

Please let me know the post that you are editing and I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.

Looking forward to your reply.
Thanks

March 29, 2024 at 6:13 am #15463043

yusukeI-2

Thank you for contacting me!
We are very busy working on the release today and will contact you again once we have created a test environment.
Please wait as we need a little time.

March 29, 2024 at 7:05 am #15463167

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Sure, I'm waiting for your feedback.

Thanks.

April 1, 2024 at 2:44 am #15467897

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I see that issue on your site and the workaround applied https://wpml.org/errata/advanced-custom-fields-fatal-error-uncaught-typeerror-illegal-offset-type-in-isset-or-empty-in/

However, I don't see the same symptom as noted in the documentation (fatal error) so I reverted the changes and you can see the gallery field works properly.

Edit the file /wp-content/plugins/acfml/classes/class-wpml-acf-attachments.php, around line 28, replace the workaround code:

foreach ( $attachments as $key => $attachment_id ) {
    if (is_int($attachment_id)) {
        $translated_attachments[ $key ] = apply_filters( 'wpml_object_id', $attachment_id, 'attachment', true );
    }

with the default

foreach ( $attachments as $key => $attachment_id ) {
        $translated_attachments[ $key ] = apply_filters( 'wpml_object_id', $attachment_id, 'attachment', true );

Looking forward to your reply.
Thanks

Edit 実績 “イオンモール徳島” ‹ 太陽工業株式会社 — WordPress 2024-04-01 09-43-36.jpg
イオンモール徳島 | 太陽工業株式会社 2024-04-01 09-43-19.jpg
April 2, 2024 at 7:16 am #15471160
yusukeI-2

Sorry for the late reply.
The error was resolved with what you supported! Thank you very much for your help.

In addition, I have one more question,
Is it possible to automatically translate German and Chinese into English for each article while the base language remains Japanese?

Thank you very much for your help.

New threads created by Long Nguyen and linked to this one are listed below:

https://wpml.org/forums/topic/is-it-possible-to-automatically-translate-german-and-chinese-into-english/

April 2, 2024 at 7:34 am #15471180

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

We limit one issue per ticket only so I will split your new issue with automatic translation into a new ticket.

If you see the main issue of this ticket with image gallery is resolved, please mark it as Resolved.

Thanks.

April 2, 2024 at 8:16 am #15471431

yusukeI-2

Understood.
Then I will inquire again for another ticket.

Thank you very much!