 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Thank you for your patience and cooperation.
I was able to reproduce the problem in a fresh setup and 've escalated the matter to our compatibility team for investigation.
I'll get back to you accordingly.
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
The matter is still with our compatibility team. I'm checking about it. Please accept our apologies for the delay due to some load in the queue.
I'll update you as soon as I hear back.
Thank you for your patience and cooperation.
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Thank you for your patience and cooperation. Our team has debugged the issue and have provided the following temporary workaround:
- Take full backup of your site and database.
- Open app/public/wp-content/plugins/wp-seopress/templates/sitemap/single.php file for editing.
- Look for the following snippet, around line 41:
// WPML Workaround
if (class_exists('SitePress')) {
if ( 2 != apply_filters( 'wpml_setting', false, 'language_negotiation_type' ) ) {
$original_language = apply_filters( 'wpml_current_language', NULL );
$language_list = apply_filters( 'wpml_active_languages', NULL, 'orderby=id&order=desc' );
if (!empty($language_list)) {
foreach ($language_list as $key => $language_infos ) {
if ($original_language != $language_infos['language_code']) {
// Switch Language
do_action( 'wpml_switch_language', $language_infos['language_code']);
$archive_links[] = htmlspecialchars(urldecode(user_trailingslashit(get_post_type_archive_link($path))));
// Restore language to the original
do_action( 'wpml_switch_language', $original_language);
}
}
}
}
- Replace with:
// WPML Workaround for compsupp-7538 and compsupp-6419
if ( class_exists('SitePress' )) {
if ( 2 != apply_filters( 'wpml_setting', false, 'language_negotiation_type' ) ) {
$original_language = apply_filters( 'wpml_current_language', NULL );
$language_list = apply_filters( 'wpml_active_languages', NULL, 'orderby=id&order=desc' );
if (!empty($language_list)) {
foreach ($language_list as $key => $language_infos ) {
if ($original_language != $language_infos['language_code']) {
// Switch Language
do_action( 'wpml_switch_language', $language_infos['language_code']);
if ( $path == 'product' && function_exists('wc_get_page_id') ) {
$shop_page_id = wc_get_page_id('shop');
$archive_links[] = htmlspecialchars(urldecode(user_trailingslashit(get_permalink($shop_page_id))));
} else {
$archive_links[] = htmlspecialchars(urldecode(user_trailingslashit(get_post_type_archive_link($path))));
}
// Restore language to the original
do_action( 'wpml_switch_language', $original_language);
}
}
}
}
}
- Save the file and recheck.
I've tried this in the sandbox site (hidden link) and it seems to work fine.
Please let me know after applying and checking the above mentioned.
|
 alexanderS-177
|
Thank you very much. It's working.
However, won't this be deleted once we update the plugin?
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Thank you for confirming and glad it worked for you too.
Yes when plugin is updated, that'd be deleted. However, whenever there's a new update of the plugin, please keep following in mind:
- Take a backup before update.
- Keep this ticket bookmarked or save the solution to a suitable place.
So after updating if issue returns, you can compare if it was rolled out or not and you can act accordingly.
Usually, for such issues our team publishes an erratum, which you can follow to observe the release of the fix. I'll let you know as soon as the erratum is published.
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Our team has published the errata at https://wpml.org/errata/seopress-product-archive-slug-not-translated-in-sitemaps/. Please subscribe to the comments on this errata for future updates.
|