Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

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.

Our next available supporter will start replying to tickets in about 10.62 hours from now. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by Yuri 2 years, 4 months ago.

Assigned support staff: Yuri.

Author Posts
July 28, 2017 at 12:36 pm #1329677

Nohemi

Hi,

Even if i check the "Synchronize page order for translations" option, menu_order is not synchronized between posts.

I found the problem inside wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-synchronization.class.php file at line 211 (WPML 3.7.1) :

 $query = $wpdb->prepare(
                "UPDATE {$wpdb->posts}
                   SET menu_order=%s
                   WHERE ID IN (%s)",
                $menu_order,
                wpml_prepare_in( $translated_ids, '%d' )
            );

The ids list is considered as a string so the sql produced looks like

UPDATE car_posts
				   SET menu_order='49'
				   WHERE ID IN ('6338,6331,6340,6324,6334,6336')

All the ids are in the same string...

To fix this you must treat ids like int. For exemple like this

$query = $wpdb->prepare(
				"UPDATE {$wpdb->posts}
				   SET menu_order=%s
				   WHERE ID IN (".implode(',',array_map('intval',$translated_ids)).")",
				$menu_order
			);
July 28, 2017 at 2:03 pm #1329771

Yuri

Hi, I've added the information you provided to our internal tracking system so our developers can evaluate the issue and apply the patch.

Thank you for bringing this to our attention!

September 5, 2017 at 11:17 am #1359698

Yuri

Hi, I'm happy to inform you that this issue has been corrected in our latest version of WPML 3.8.

Please backup your site and upgrade to test this and let me know if there are any issues with it.