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.
This topic contains 17 replies, has 7 voices.
Last updated by mohammeda-24 4 years, 1 month ago.
Assisted by: Bruno Kos.
Author | Posts |
---|---|
December 16, 2020 at 8:43 pm #7680917 | |
François Duroy |
I am trying to: migrate my local WP website to an online staging environment Link to a page where the issue can be seen: hidden link I expected to see: an horizontal language switcher with css applied to
Instead, I got: a vertical language switcher (dropdown mode) and no css applied. The project has no bug on the local env and the language switcher is horizontal with css applied. The database and WP files deployment went smoothly but when visiting the file we noted that bug in the header. After investigating, we noticed a wrong URL in that the wp-options table. That record is about the language switcher preferences and some css. In the wp-options table, search for the string ´wpml_language_switcher_template_objects´ and check the option_value column. Basically, the URL pointing to some settings done withing the "Languages section" of WPML admin panel is messed up. Instead of ".../wp-content/plugings/..." we have ".../ontent/plugings/...". This wrong URL is showing at several places in that column value. When we replace that URL, it gets overriden eventually as if the plugin wanted to keep the URL like this. And when I try to change the settings inside the WPML admin, like switching from horizontal to vertical, save and then back to kind of try to override that value I am actually stuck and cannot even apply those changes. |
December 17, 2020 at 8:53 am #7683629 | |
François Duroy |
I am waiting for an assistance on this issue, thanks a lot... (have to write this because of the robot notification announcing the ticket will be closed) |
December 17, 2020 at 1:04 pm #7685473 | |
George Botsev Supporter
Languages: English (English ) Timezone: Europe/Sofia (GMT+02:00) |
Hello! Please always remember to create at least a database backup before modifying the database, and in best scenario - a full website backup. |
December 17, 2020 at 1:05 pm #7685479 | |
George Botsev Supporter
Languages: English (English ) Timezone: Europe/Sofia (GMT+02:00) |
You might have to re-save the language switcher first, in order to have everything working. |
December 17, 2020 at 4:29 pm #7687563 | |
François Duroy |
Hi George, I disagree with your opinion. The migration I made worked locally. Then the deploy on the online staging, done with project n°2, was successful ! Not one problem but that WPML record! But, I may ask my colleague to delete that record if you think it can be done safely and apply those settings again manually with the WPML Admin dashboard to let's say create a brand new record and see how it goes... Do you confirm it's safe doing it this way??? |
December 17, 2020 at 7:33 pm #7688713 | |
François Duroy |
Hello George, I didn't wait for your confirmation for that DB record removal. We need that staging ready as soon as possible and we got actually delayed a lot by using WPML plugin: 2 bugs with you guys ! It is taking time to report and slowing the dev down... Here are the steps we did to try and solve that problem: 1) We deleted the record from the online database, it was recreated automatically..! Please could you give us clear instructions because we really don't know what to do ! Thanks very much in advance for your help |
December 20, 2020 at 6:26 am #7702677 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, This is a really very odd issue. The language switcher is applied into the Elementor Template "Uci Header 2" as Custom Language Switcher. Now, it appears on the site, which makes me wonder, as the option for Custom Language Switcher is not even enabled in WPML -> LAnguages -> Custom Language Switcher. Then I see you are calling the class .wpml-ls-legacy-list-horizontal in your child-theme CSS. But in fact, the element has applied those classes, whihc might be related to the Elementor Language Switcher Widget itself: <div class="wpml-ls-statics-shortcode_actions wpml-ls wpml-ls-legacy-list-vertical"> <ul> <li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-pt-pt wpml-ls-current-language wpml-ls-first-item wpml-ls-item-legacy-list-vertical"> <a href="#" class="wpml-ls-link"><span class="wpml-ls-native">PT</span></a> </li> <li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-fr wpml-ls-item-legacy-list-vertical"> <a href="#" class="wpml-ls-link"><span class="wpml-ls-native" lang="fr">FR</span></a> </li> <li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-en wpml-ls-last-item wpml-ls-item-legacy-list-vertical"> <a href="#" class="wpml-ls-link"><span class="wpml-ls-native" lang="en">EN</span></a> </li> </ul> </div> Now, what I could do as a quick fix, was adding some positioning and custom CSS inside the Elementor Template Editor. See screenshots. I do not see a problem here, only issue is that thos language switcher should not show up as long inside WPML the Custom Language Switcher is disabled. Could you please add Elementor PRO and the Astra Theme in their latest versions to this sandbox, as we should try to recreate this issue: One-Click-Login: IMPORTANT: Leave us a short notification once the componenets are installed. Best regards |
December 20, 2020 at 4:37 pm #7704313 | |
Bruno Kos Supporter
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+01:00) |
Hi, It seems like that this bug has been reported before: If possible, I suggest you go over that second thread and translate from French in case you don't speak the language. Looks like a quite specific and difficult issue without solution in sight, even though it has been escalated to developers some time ago. It is possibly not even solvable now based on how we compare the length of one path to the length of the resultant path. According to development ticket, it happens if something like this is used: define('WP_PLUGIN_DIR', 'E:\laragon\www\wp-content\plugins'); It does not match the base path because of: $relative_path = substr( $path, strlen( $base['path'] ) ); So it trims the url. It might also happen if the hosting service is hardcoding ABSPATH to implement their WordPress hosting service. The only workaround that was suggested there was to copy the template file (so /sitepress-multilingual-cms/templates/language-switchers/legacy-list-vertical/style.css?ver=1) into your theme and load it from there. All this being said, this issue has been escalated to WPML developers already and I will keep this thread updated as soon as I get any new information from them! However since there have been no movement there for a while, I suggest you try implementing this CSS through theme or any other means (so like https://developer.wordpress.org/themes/basics/including-css-javascript/#stylesheets). Regards, |
December 22, 2020 at 2:41 pm #7717505 | |
François Duroy |
Hello again Andreas, Thanks for your assistance. Please excuse me if I say stupid things but my experience with the plugin is really short. I was actually not working with Custom Language Switcher but with Widget Language Switcher. When trying to debug that DB problem with my colleague, we deleted it (the widget) and re-created it to see if it had any impact on the database. See the steps described above within my message to George. So I must have ended up without any widget language switcher when I left it for you to take it over. This is why there is nothing today but there was before.. See the printscreen below. I see now the website is different from your printscreen..The logo is missing. I personaly did not touch anything in order not to add another layer of mess. Regarding this sandbox, it's the first time I am working with this.. just to make sure, you only want me to download and activate Astra and add Elementor Pro and activate it there, that's all? Thanks for your assistance |
December 22, 2020 at 2:44 pm #7717631 | |
Bruno Kos Supporter
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+01:00) |
Hi, I took over this ticket and analyse it - have you seen this reply of mine? Regards, |
December 22, 2020 at 2:49 pm #7717651 | |
François Duroy |
Hi Bruno, I was first answering Andreas's message before answering yours.. |
December 22, 2020 at 3:18 pm #7717881 | |
François Duroy |
Hello again Bruno, Ok, so the workaround is to copy that css file into my child theme, right? I get it.. but what do you mean by "Load it from there"? I suppose the css file is set up with values coming from me making choices in the WPML Language section when editing the widget switcher.. How am I suppose to indicate the plugin that the css file is somewhere else than the default location? |
December 22, 2020 at 3:31 pm #7717953 | |
François Duroy |
Oh sorry I missed that link in the other post.. All right so just adding the css rules somewhere else and not style anything in the WPML widget switcher admin panel I guess?? At the moment, the database is acting weird with that record, and therefore the widget switcher is not functioning anymore. So what shall I do? |
December 22, 2020 at 3:53 pm #7718161 | |
Bruno Kos Supporter
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+01:00) |
Hi, Ok, here is the deal - if you open this url and check the chrome console, you will find many 404 files - hidden link These are 404 because of wrong url, so like: etc. But should be: on which if you replace "wp-content" with "ontent", you get these files. So If got our 2nd tier right (they didn't have many ideas either), you should: Or you can also see this: Regards, |
December 22, 2020 at 7:19 pm #7719469 | |
François Duroy |
Thanks Bruno, |