Skip to content Skip to sidebar

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

Problem:
When linking to popups in Elementor, the links revert to the original language version each time the page or its translations are updated.
Solution:
We identified that this issue might be related to caching in Elementor. Clearing the cache in Elementor > Tools might temporarily resolve the display issues. However, for a more permanent fix, consider recreating the buttons that trigger the popups on your pages. Additionally, we have provided a workaround involving adding specific code to your functions.php file:

/**
 * Convert the popup link in a container
 * compsupp-7641 workaround
 */
add_filter( 'wpml_pb_elementor_widget_dynamic_id_converters', function( $converters ) {
	$isContainer = \WPML\FP\Relation::propEq( 'elType', 'container' );

	$containerLinksLens = \WPML\FP\compose(
		\WPML\FP\Obj::lensProp( 'settings' ),
		\WPML\FP\Obj::lensPath( [ '__dynamic__', 'link' ] )
	);
	return array_merge(
		$converters,
		[
				[ $isContainer, $containerLinksLens, 'popup', 'popup' ],
		]
	);
} );

Please ensure to back up your site before applying this code. If this solution does not resolve your issue or becomes irrelevant due to updates, we 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 issues persist, please open a new support ticket.

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

Last updated by Kor 11 months, 1 week ago.

Assisted by: Kor.

Author Posts
October 15, 2024 at 1:11 pm #16290924

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

We have a workaround for this. Please apply the workaround below to your Website. Also, backup before you proceed.

Add the following code to your functions.php file:

/**
 * Convert the popup link in an container
 * compsupp-7641 workaround
 */
add_filter( 'wpml_pb_elementor_widget_dynamic_id_converters', function( $converters ) {
	$isContainer = \WPML\FP\Relation::propEq( 'elType', 'container' );

	$containerLinksLens = \WPML\FP\compose(
		\WPML\FP\Obj::lensProp( 'settings' ),
		\WPML\FP\Obj::lensPath( [ '__dynamic__', 'link' ] )
	);
	return array_merge(
		$converters,
		[
				[ $isContainer, $containerLinksLens, 'popup', 'popup' ],
		]
	);
} );
October 15, 2024 at 11:19 pm #16292821

skyE

Nice -- thank you so much!! So, do you know, does that issue not exist with the old style / non-container based layout/sections? Like, if I hadn't converted the section to containers, would I have avoided the issue? Thanks again!

October 16, 2024 at 12:42 am #16292874

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

This is caused by some changes with the Elementor plugin and we've notified the plugin developer. If you encounter similar issues in the future, feel free to contact us again.

October 18, 2024 at 2:50 am #16302471

skyE

OK, thanks so much for your help on this!