Skip Navigation

[Resolved] WPML Translated URL-Link using Types Shortcode is incorrect: only p=XXXX used

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

Problem: I am using the wpv-post-url shortcode as a shortcode attribute in a Divi button. It works well in the primary language, but in the secondary language the button redirects to the wrong URL. It should redirect to the pretty permalink, but instead it shows the post ID in a URL parameter like https://yoursite.com/?p=12345. If I place the wpv-post-url shortcode outside the Divi button shortcode, it shows the correct URL. Only in another shortcode attribute is the problem reproducible.

Solution: Update to WPML 4.3.16 to get the fix for this issue.

This support ticket is created 4 years 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 17 replies, has 2 voices.

Last updated by julianC-2 3 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1578803
ENGLISH.png
GERMAN.png

I am trying to:

I updated WPML and Toolset Plugins we are using. Now, the following issue occurs:

Link to a page where the issue can be seen:
On our pages using the german language everything works fine. However, when switching to English language the links are not correct anymore.

E.g. On the following pages you can see the issue:
GERMAN: hidden link
ENGLISH: hidden link

The link on OXID 6 Plugin that leads to the manual for the different languages:
GERMAN: hidden link
ENGLISH: hidden link

In this case the english link is supposed to be hidden link and NOT the one that is currently shown: hidden link

I expected to see:
As a Link: hidden link

Instead, I got:
As a Link: hidden link

The links are using the toolset shortcode "{!{wpv-post-url}!}" which is contained in a toolset view referencing to a custom post type ("anleitung").

#1579029

Hi, have you tried resaving your site's permalinks in wp-admin > Settings > Permalinks?
Have you tried using Sticky Links from WPML? https://wpml.org/documentation/getting-started-guide/sticky-links/
Those are the two things I would try first, then if still experiencing link issues I'll be glad to take a closer look.

#1579615

Hey Christian.

thank you for your speedy reply.

I tried resaving the permalinks as well as installed the Sticky Links Plugin and executed it. Unfortunately, the issue prevails and I would thus appreciate your help!

Thank you again and all the best
Julian

#1579711

Hi again,

I was able to reproduce which update caused the error exactly. It was the update of the Plugin "WPML Multilingual CMS" from Version 4.3.6 to Version 4.3.11.
I even tried to update the beta version 4.3.12-b.1 (and restoring permalinks and using sticky Links) but it did not solve the issue.

Looking forward to hearing from you.
Julian

#1583067

Thank you for the additional information. Can you edit this View and copy + paste the information from the Loop Editor into your next reply? I would like to see how the Divi template is inserted in the loop contents. I'll review this code and give you some feedback.

#1584883

Hi Christian,

The Loop Editor's content:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
		<wpv-loop>[wpv-post-body view_template="connections-auflistung"]
		</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

And the view template:

[et_pb_section bb_built="1" _builder_version="3.21.1" custom_margin="0px|0px|0px|0px" custom_padding="0px|0px|0px|0px" z_index_tablet="500" disabled="off" disabled_on="off|off|"][et_pb_row _builder_version="3.21.1" module_alignment="center" custom_margin="0px|0px|0px|0px" custom_padding="0px|0px|0px|0px" z_index_tablet="500" make_fullwidth="on" make_equal="on" custom_css_main_2="margin:auto;" module_class="two-columns"][et_pb_column type="1_2"][et_pb_image admin_label="Grafik" _builder_version="3.21.1" use_overlay="on" hover_overlay_color="rgba(255,255,255,0.6)" align="center" saved_tabs="all" overlay_icon_color="rgba(255,255,255,0)" z_index_tablet="500" hover_icon="%%2298%%" src="{!{wpv-post-featured-image output=%22url%22}!}" custom_css_main_element="padding-bottom:10px;" always_center_on_mobile="off" show_bottom_space="off" /][/et_pb_column][et_pb_column type="1_2"][et_pb_button _builder_version="3.21.1" button_text="Infos" button_url="/connections/?connection-id={!{wpv-post-id}!}" z_index_tablet="500" button_alignment="center" custom_button="on" button_border_color="#009aa3" button_letter_spacing="1" button_font="Exo 2|600||on|||||" button_use_icon="off" custom_margin="3px|3px|6px|3px" custom_padding="3px|6px|3px|6px" custom_css_main_element="font-size:14px;" module_class="full-width" url_new_window="on" /][et_pb_button _builder_version="3.21.1" button_text="Anleitung" button_url="{!{wpv-post-url}!}" z_index_tablet="500" button_alignment="center" custom_button="on" button_border_color="#009aa3" button_letter_spacing="1" button_font="Exo 2|600||on|||||" button_use_icon="off" custom_margin="3px|3px|3px|3px" custom_padding="3px|6px|3px|6px" custom_css_main_element="font-size:14px;" module_class="full-width" url_new_window="on" /][/et_pb_column][/et_pb_row][/et_pb_section]

Since this error blocks our live page I would appreciate you quick reply.

Thanks and all the best
Julian

#1585421

Okay first I would try replacing the wpv-post-body template shortcode in the View's loop with the actual contents of that template. In other words, bypass the need for a Content Template by placing that content directly in the loop:

[wpv-layout-start]
    [wpv-items-found]
    <!-- wpv-loop-start -->
        <wpv-loop>[et_pb_section bb_built="1" _builder_version="3.21.1" custom_margin="0px|0px|0px|0px" custom_padding="0px|0px|0px|0px" z_index_tablet="500" disabled="off" disabled_on="off|off|"][et_pb_row _builder_version="3.21.1" module_alignment="center" custom_margin="0px|0px|0px|0px" custom_padding="0px|0px|0px|0px" z_index_tablet="500" make_fullwidth="on" make_equal="on" custom_css_main_2="margin:auto;" module_class="two-columns"][et_pb_column type="1_2"][et_pb_image admin_label="Grafik" _builder_version="3.21.1" use_overlay="on" hover_overlay_color="rgba(255,255,255,0.6)" align="center" saved_tabs="all" overlay_icon_color="rgba(255,255,255,0)" z_index_tablet="500" hover_icon="%%2298%%" src="{!{wpv-post-featured-image output=%22url%22}!}" custom_css_main_element="padding-bottom:10px;" always_center_on_mobile="off" show_bottom_space="off" /][/et_pb_column][et_pb_column type="1_2"][et_pb_button _builder_version="3.21.1" button_text="Infos" button_url="/connections/?connection-id={!{wpv-post-id}!}" z_index_tablet="500" button_alignment="center" custom_button="on" button_border_color="#009aa3" button_letter_spacing="1" button_font="Exo 2|600||on|||||" button_use_icon="off" custom_margin="3px|3px|6px|3px" custom_padding="3px|6px|3px|6px" custom_css_main_element="font-size:14px;" module_class="full-width" url_new_window="on" /][et_pb_button _builder_version="3.21.1" button_text="Anleitung" button_url="{!{wpv-post-url}!}" z_index_tablet="500" button_alignment="center" custom_button="on" button_border_color="#009aa3" button_letter_spacing="1" button_font="Exo 2|600||on|||||" button_use_icon="off" custom_margin="3px|3px|3px|3px" custom_padding="3px|6px|3px|6px" custom_css_main_element="font-size:14px;" module_class="full-width" url_new_window="on" /][/et_pb_column][/et_pb_row][/et_pb_section]
        </wpv-loop>
    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
        <strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
    [/wpv-no-items-found]
[wpv-layout-end]

I am checking the English version of the live site now and I can see that the link is showing correctly for the Oxid 6 Manual, so I assume you have not updated the WPML plugin on the live site yet?
https://uptain.de/en/plugins-and-shop-systems/

#1585607

Hi,

since we had several error I needed to rollback - we are now back to using the old version.

You may access the wrong version here:

hidden link

I changed the loop as described by you - still not working.

Julian

#1587081

Okay at this point it's probably best for me to try to create a clone of your site (the broken site) so I can run some additional tests. If that's okay with you, please provide admin login credentials in the private reply fields here.

#1588199

Hi Christian,

are you done with the copying? I will need to reset the test server soon in order to solve another issue.

Best
Julian

#1588533

Working on it right now, stand by.

#1588603

I have created the clone, downloaded it, deleted the backup from the server, and removed the Duplicator plugin. Feel free to close out this site if needed, thanks! I'll follow up soon with some feedback.

#1588973

Okay I'm escalating this to my 2nd tier support team for a closer look. It's strange, because if you place the wpv-post-url directly in the View's loop, it resolves to the pretty permalink URL. However, if you place that shortcode inside the attribute of another shortcode, like in the button_url attribute of a Divi button element, the shortcode doesn't resolve correctly. I've asked for some feedback on this and I'll let you know what I find out. Unfortunately I don't have a quick fix available right now.

#1593363

After some discussion among our team, it turns out there is a similar issue already under investigation by the WPML team. Rather than bounce you around between the forums, I will continue assisting you here. The workaround presented in the other ticket doesn't seem to help in your case though. Your Anleitungen post type is already set to Translatable only. I'm asking the WPML team to confirm this is indeed the same issue. I'll give you some feedback as soon as possible.

Similar ticket in WPML:
https://wpml.org/forums/topic/wrong-links-in-enfold-button-elements/

#1595685

Okay yes, it does seem to be the same issue based on feedback from my WPML team. The View is shown in a custom Page, and the Page post type is set to "Translatable - use translation if available or fallback to default language" in WPML > Settings. If we change that to "Translatable - only show translated items" the problem is resolved. I will keep you posted as I receive more information from the WPML team.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.