Skip Navigation

[Closed] Custom Field REST API attachment_id null with activated WPML

This support ticket is created 2 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 5 replies, has 2 voices.

Last updated by Christopher Amirian 2 years, 4 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2542579

I am trying to: I need to get the attachment_id of custom field through Rest API of custom post, all things are working well till I activated the WPML plugin. I figure out that this is related to translated custom post type (after translation of the post to second language, the attachment_id will again appear).

Link to a page where the issue can be seen: dev environment

I expected to see:
I expect to get the attachment_id of the custom field regardless of the translation. Our Customer want to add the second language sometimes later.

Instead, I got:
before WPML -> attachment ID is correct
after WPML (without translation of post) -> attachment_id is null (url is in but I need the attachment_id)
after post translation -> attachement_id is again set (only If I don't translate the post with duplicate function)

#2543667

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Would you please follow the steps below and see if it fixes the issue?

- Go to "WordPress Dashboard > WPML > Settings > Media Translation".
- Make sure that all the enabled checkboxes there are checked.
- Click the "Start" button.
- Wait for the process to finish.

Thanks.

#2544151

Hey Christropher,

thanks for your Feedback, we already tried something in this direction.

The Problem is:
In this Case the Second language is in progress (content will be added later or with delay) as long as the second language is not created the attachment ID of "main" language is null. In my opinion, this cant be right?

Thanks.

#2544961

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Let's see if this can be replicated on a clean installation so that I can report this to the development team.

I created a clean installation of Toolset and WPML:

hidden link

I'd appreciate it if you can add a custom field and a sample post and replicate the issue with your code so that we can investigate this further.

Thanks.

#2551101

Hey Christopher,

can you please setup a new sandbox ?

Thanks.

#2552975

Christopher Amirian
Supporter

Languages: English (English )

Hi there

Sure, here is the Sandbox:

hidden link

Please make sure that you replicate the issue within seven days. If not, the Sandbox will be deleted automatically.

Thanks.

The topic ‘[Closed] Custom Field REST API attachment_id null with activated WPML’ is closed to new replies.