jamesF-7
Hello, I followed this example article: https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/preserve-url-arguments-when-switching-languages/
However, it is not working. I am trying to preserve the 'code' param.
Christopher Amirian
WPML Supporter since 07/2020
Languages:
English (English )
Timezone:
Asia/Yerevan (GMT+04:00)
Hi there,
You are using a very old version of WPML and that might be contributing factor.
- IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website.
- Go to "WordPress Dashboard > Plugins > Add new > Commercial (tab)".
- Click the "Check for Updates" button.
- Update WPML and its addons there.
For more information:
https://wpml.org/faq/install-wpml/#automated-updates
Thanks.
jamesF-7
Hello,
I updated all of the WPML plugins, and the issue persists.
Christopher Amirian
WPML Supporter since 07/2020
Languages:
English (English )
Timezone:
Asia/Yerevan (GMT+04:00)
Hi there,
Thank you. Would you get back to us with the login information of your site so we can test, also please tell us which page and query parameter to check.
make sure you mark the next reply as private.
Christopher Amirian
WPML Supporter since 07/2020
Languages:
English (English )
Timezone:
Asia/Yerevan (GMT+04:00)
Hi there,
Thank you I see the issue. I wonder if we have permission to copy your website to our server to be able to see if the issue is happening there or not and be able to report this to the second tier support?
Christopher Amirian
WPML Supporter since 07/2020
Languages:
English (English )
Timezone:
Asia/Yerevan (GMT+04:00)
Hi there,
Thank you very much. Unfortunately, the system asks for DFA Code which I do not have access too.
Would you please deactivate that additional security step so I can access?
Thanks.
jamesF-7
OK, I will likely have to manually provide an export due to this environment. I will follow up when we have it.
jamesF-7
Hello, I have an export of the site prepared. It's a zip of all files. How can I best get this to you?
Christopher Amirian
WPML Supporter since 07/2020
Languages:
English (English )
Timezone:
Asia/Yerevan (GMT+04:00)
Hi there,
The best way is to use a third part service such as wetransfer to upload the file.
You can use the method below if the file size is not too big:
https://wpml.org/faq/provide-supporters-copy-site/
Also give us the instruction on how to use the ZIP file to install the website.
Thanks.
Christopher Amirian
WPML Supporter since 07/2020
Languages:
English (English )
Timezone:
Asia/Yerevan (GMT+04:00)
Hi there,
Thank you very much, the issue os reported to the second tier support and I will get back to you as soon as I have an update.
Thank you.
Christopher Amirian
WPML Supporter since 07/2020
Languages:
English (English )
Timezone:
Asia/Yerevan (GMT+04:00)
Hi there,
Our awesome second tier support has an update. There are two options that you can use:
Option 1
They should set the page to Translatable only and it should work after pages are translated.
Option 2
Edit wp-content\plugins\sitepress-multilingual-cms\sitepress.class.php, go to line 2942 and replace
} else {
$translated_url = $display_as_translated_ls_link->get_url( $translations, $lang['code'] );
if ( $translated_url ) {
$lang['translated_url'] = $translated_url;
} else {
if ( $icl_lso_link_empty ) {
if ( ! empty( $link_empty_to ) ) {
$lang['translated_url'] = str_replace( '{%lang}', $lang['code'], $link_empty_to );
} else {
$lang['translated_url'] = $this->language_url( $lang['code'], true );
}
} else {
$skip_lang = true;
}
}
$lang['missing'] = 1;
}
With:
} else {
$translated_url = $display_as_translated_ls_link->get_url( $translations, $lang['code'] );
if ( $translated_url ) {
$lang['translated_url'] = $translated_url;
$lang['missing'] = 0;
} else {
if ( $icl_lso_link_empty ) {
if ( ! empty( $link_empty_to ) ) {
$lang['translated_url'] = str_replace( '{%lang}', $lang['code'], $link_empty_to );
} else {
$lang['translated_url'] = $this->language_url( $lang['code'], true );
}
} else {
$skip_lang = true;
}
$lang['missing'] = 1;
}
}
Please get back to us with the result.
Thanks.
jamesF-7
Thanks! I'd like to avoid modifying the core files. Is there a filter or action we could use?
If not, please outline the steps needed to be taken for solution #1
Christopher Amirian
WPML Supporter since 07/2020
Languages:
English (English )
Timezone:
Asia/Yerevan (GMT+04:00)
Hi there,
I asked and will get back to you.
Meanwhile, the core change is a workaround that you can use.
We already reported this to the development team and it will be checked but a working solution might take a while.
So for now the code file change should be the best option.