Skip Navigation

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

Problem:

I have two CPTs with an ACF relationship (1-n): software-area -> software-service. WPML is overwriting the permalink for every software service so that they point to their related area. This happens in every language, and when I disable WPML, the permalinks work properly.

Solution:

This is a known issue with LearnDash and the "Enable Nested URLs" option.

The client reported the following.

The issue was due to the nested URLs structure between the two CPTs, and I found this issue: https://wpml.org/errata/learndash-enable-nested-urls-conflict-with-appear-as-translated-mode/

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.

This topic contains 5 replies, has 2 voices.

Last updated by miguel-manuelM 1 year, 8 months ago.

Assisted by: Itamar.

Author Posts
May 12, 2023 at 12:39 pm #13637423

miguel-manuelM

Good evening,
I have configurated and just started translating a development website and I encountered a strange error that I do not know how to tackle.

I have two CPTs that have an ACF relationship between them (1-n): software-area -> software-service. WPML is overwritting the permalink for every software service so that they point to their related area. This can be observed in the service grid of this page: hidden link

This happens in every language and when I disable it the permalinks work properly. I have reviewed the configuration regarding the cpts and everything seems fine, so I might be missing something.

Regards,
Miguel.

May 14, 2023 at 7:02 pm #13643891

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Miguel.

In Spanish, I can see 6 items in the grid. 5 of them point to the same page hidden link. And only one, Salesforce, points to hidden link. In English, I can see only one item, Oracle JD Edwards. It also points to the same page hidden link.

I cannot understand how you have configured things on your site.

Can you please give me access to your site and explain where to go to see the configuration you mentioned above?

If you need further help with this, please share the access details to your site with me.
I'm enabling a private message for the following reply.

Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Regards,
Itamar.

May 16, 2023 at 11:26 am #13655747

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, and thanks for the access details.

I can access your site.

Please give me more details about this issue.

1. Which field group should I check?
2. How did you create the CPTs?
3. How did you make the rulership between them?
4. Is Elementor involved in displaying this section?

If you can, please attach screenshots.

Thanks,
Itamar.

May 16, 2023 at 2:15 pm #13657231

miguel-manuelM

Good evening,
1: The field is "software-area-of-service" within the group "Software Services". However, I dont think the ACF field is the issue, because adding the posts in other pages or widgets also result in an overwritten permalink it seems that it is an issue with the CPT itself.
2: I created the CPT via code through a custom plugin. The only peculiarity I can think of is that permalinks for the CPT follows the rule: {host}/{area}/{service} through custom hooks.
3: One to many: A software area owns several software services, the relationship is defined via a ACF field that belongs to the service. Nonetheless, as I mentioned, this might not be the issue.
4: Elementor is indeed involved in displaying this section and also a custom query (but using another widget without the custom query does not solve the issue)

I'm not sure what screenshots would you find helpful so I´ve taken ones regarding the configuration of WPML, the CPTs code and the ACF field. If you need more please let me know.

Regards.

wpml config.PNG
cpts.PNG
acf_field.PNG
May 16, 2023 at 7:03 pm #13659277

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, and thanks for the detailed explanation.

According to what you wrote, the problem might be in the CPT code. Please try to isolate this issue.

If possible, get your site into a minimum environment. Minimum environment means switching to a default WordPress theme like TwentyTwenty-One and no plugins activated except WPML and the CPT custom plugin.

First, you will need to check if the problem persists when just the theme is switched to TwentyTwenty-One. If it persists, then deactivate all plugins except the WPML, its add-ons, and the CPT custom plugin. Then please check if the problem persists and report to me your findings.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****


*** If your site is live, you might want to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***

Thanks,
Itamar.

May 17, 2023 at 9:52 am #13663135

miguel-manuelM

Good morning,
The issue was due to the nested urls structure between the two CPTs, I found this issue: https://wpml.org/errata/learndash-enable-nested-urls-conflict-with-appear-as-translated-mode/

The solution discussed in the previous link worked for my case too, I just had to mark both CPTs as "Translatable: only show translated items" instead of using the fallback option and everything worked properly. It seems that WPML might have an issue with that config option and nested urls.

Thank you so much for you assistance.