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: Exception
This topic contains 14 replies, has 2 voices.
Last updated by Waqar Ali 1 year, 10 months ago.
Assisted by: Waqar Ali.
Author | Posts |
---|---|
June 17, 2023 at 8:39 pm #13844261 | |
ingridS-9 |
I am trying to: Link to a page where the issue can be seen: I expected to see: Instead, I got: |
June 19, 2023 at 7:32 am #13847649 | |
ingridS-9 |
Additional info: Please notice the header navigation menu when you switch from default (Danish) to English. The layout works (the correct "Header" template part is selected), but the menu turns out a mix of English and Danish translations! The menus are wp_navigation Navigation Menus. They have been translated to all the site's languages (Danish, Enligsh, Norwegian and Swedish). I've been really impressed with the WPML system but also feel it has really messed up my site in ways I can't even begin to understand, please help! 🙏 |
June 19, 2023 at 7:46 am #13847897 | |
ingridS-9 |
Also please note that if I delete the old "Header" template part from the mother theme, it still shows up! I tried translating all templates and template parts to check if that solved the template issue, it didn't. Also tried opening and re-saving all of the pages, it didn't make a difference. |
June 19, 2023 at 9:12 am #13849387 | |
ingridS-9 |
TLDR: Facing 2 issues: |
June 20, 2023 at 7:40 am #13856429 | |
Waqar Ali |
Hi, Thank you for contacting us and I'd be happy to assist. I've performed some tests on my website, but couldn't reproduce these issues. This suggests that something specific to your website is involved. If the issues are appearing intermittently, it could be related to the cache policies, being applied by the cache plugin or the server. Can you please temporarily deactivate all cache and code optimization plugins and then test the header and the navigation menu? In case the issues still persist, you're welcome to share temporary admin login details, in reply to this message. Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details. Let me know how it goes. regards, |
June 20, 2023 at 11:33 am #13858791 | |
ingridS-9 |
Hi Waqar, thanks for looking into it! I've disabled WP Super Cache. Issues still persist. Is there any way we can continue without sharing admin access? As the site contains sensitive information like member datas etc. and the organization is kind of shy, I'm sorry about this inconvenient/annoying impasse. However I've googled the issue and come across a handful of other users experiencing similar issues, so I'm hoping for some theories on what's actually going on here so I might be able to troubleshoot it myself 🙏 Could the child theme be the issue? It does look like WPML reads out templates and template parts from the mother theme, which to me is unexpected behavior that could possibly explain what's going on. Does WPML support use of child themes? |
June 20, 2023 at 11:42 am #13858813 | |
ingridS-9 |
By the way - I tried loading the site from a device that has not loaded it before. Getting the same behavior. You mean to say it's not reproducible on your end? Also, I'm stumped that the plugin keeps picking the mother template parts even if I physically remove them from the mother theme. Makes me think WPML caches them somewhere? |
June 23, 2023 at 5:24 pm #13886659 | |
ingridS-9 |
Hi. Are you on the ball? Please get back to me. I still need some help. Since we spoke last I have tried going back to the mother theme (deleting the child theme) and removing duplicate wp_template_parts in wp_posts table. But WPML doesn't seem to understand that these translations are now gone and need to be regenerated: When I try to retranslate the template part in Admin GUI, it loads the translator, but the busy message never goes away. Weird thing is, it DOES regenerate the files in the database, although with a different slug. I tried renaming the slug, but I'm still not getting the translation page to load in Admin GUI. Please help, my site is a complete mess and I am a little desperate! |
June 23, 2023 at 6:01 pm #13887119 | |
ingridS-9 |
Update: Tried removing the template part from wp_icl_translations to force WPML to offer up creating a new translation, and now it does not appear in WPML Admin GUI at all any more. I'm guessing other WPML tables are still referencing the record I deleted, but I don't want to touch the database any further without any guidance. Please help. |
June 24, 2023 at 12:36 am #13887805 | |
Waqar Ali |
Thank you for waiting and I apologize for the delay in getting back on this. > Could the child theme be the issue? It does look like WPML reads out templates and template parts from the mother theme, which to me is unexpected behavior that could possibly explain what's going on. Does WPML support use of child themes? - Yes, WPML supports the use of child themes, following the WordPress theme standards/conventions. If the active child theme contains a template part it is used, and otherwise, the one from the parent theme is inherited. > By the way - I tried loading the site from a device that has not loaded it before. Getting the same behavior. You mean to say it's not reproducible on your end? - Currently, I'm able to see the header only in the default Danish language. For all other 3 languages, the header is not showing. > Is there any way we can continue without sharing admin access? As the site contains sensitive information like member datas etc. and the organization is kind of shy, I'm sorry about this inconvenient/annoying impasse. - I can understand the concern and assure you that we take customer data's privacy and confidentiality very seriously: Here is a sandbox website that can be used as an alternative, where you can reproduce the issue for us to see: But, in my experience, it is most efficient if the actual website's admin access is shared. This way we can see if there is some missing configuration involved and if deeper investigation is required, we can download the website's clone/snapshot, but only after the client's permission. Hope this makes sense and I'm setting your next reply as private again. |
June 24, 2023 at 6:23 pm #13889367 | |
ingridS-9 |
Hi Waqar, thanks for getting back! I'm not doubting your professionality when it comes to data privacy, but this is a special case and I'm asking that we please continue our discussion in public 🙏 I think we can sort this out by your instructing me, or, at least let us try, if you don't mind. Thank you for your understanding! Please consider my current situation: - I think there is a bug in WPMLs handling of templates and template parts in child themes. The expected behaviour you describe (defaulting to mother templates only if child template doesn't exist) is not the behaviour I'm seeing on my site: What I have seen is that 1) WPML has offered translation of ALL templates, mother and child, and 2) the site has not been able to select the correct template before or after translating them. - The above is why I ended up discarding the child theme and reverting to the mother theme. In that process I also deleted the old template parts from wp_posts table, and I pasted the correct template part into the Admin -> Appearance -> Template parts -> Header template. - That partly worked, and the correct template part (Header) showed up for original language. But WPML was not able to fetch them in translation GUI for the other languages. So I deleted the translated template parts from wp_posts table in order to force WPML to regenerate them. - WPML did regenerate them when I added the translation job again, but it was still not able to load the translation screen, it was just spinning busy forever. - I tried to force-clean it by deleting the appropriate record in wp_icl_translations, but now the translation doesn't show up at all and it is not possible to re-add it. I'm guessing some other icl tables have records on it that need to be deleted, but now the primary key is lost forever from wp_icl_translations table. Please let me know if any of the above is unclear! I really don't know where to begin recreating this in a sandbox, I'm sorry... It's just a mess. Please help. |
June 24, 2023 at 7:10 pm #13889411 | |
ingridS-9 |
Hi again Waqar, I just deleted the template part (Header) and started over, and WPML was able to let me translate it. However, the header now only shows up on original language pages. On translated pages it is simply missing. I notice that in wp_posts table the original template part has slug and guid A while the translated ones have slug and guid B. I have mutated them so they all have the same slug and guid, but getting the same result. I tried opening one of the translated pages and re-saving it in case the header was fetched there, but getting the same result. Please advise: How are template parts fetched and what could be a reason my translated pages are not able to find the translated headers? Thank you. |
June 24, 2023 at 7:16 pm #13889421 | |
ingridS-9 |
Update! Only the Front Page seems to be having this problem, all other pages are now working 🙏 So: tmp2.shinysticker.io/something - working Almost there...! Thank you for looking into this annoying issue. |
June 24, 2023 at 8:04 pm #13889489 | |
ingridS-9 |
Update! The server Front Page template was referencing the child theme. Corrected that and the Front Page now works for all translations! I guess that resolves my issue. Thank you for your input Waqar, and I hope this thread can help others having similar issues. As I understand it, there may be a bug in WPML causing it to duplicate (in database wp_posts table) templates for translation from both mother and child theme whether or not the template file exists in child theme, causing huge confusion for the site on language switching. My setup was I had developed the header (template part) in the mother theme, then at some point created a child theme and developed the finished header anew there. The header selection confusion seemed to begin immediately after installing and activating WPML, or, I had possibly added both headers to the translation basket already at this point, I'm not sure - but they were not translated yet by the time the issue began; I remember attempting to translate them to see if that would solve it. Also not sure how the server-located templates and template parts played in, as I don't understand how these are used by the site vs. the database-located files in wp_posts (are they a fallback? Are the database files fallbacks, only actively used by WPML?) That being said, I am hugely impressed with the functionality of this plugin overall as it has performed the translation tasks and management extremely well. Definitely worth every penny, just please promise me you'll look into the child theme issue 🙏 Best regards, Ingrid |
June 26, 2023 at 9:18 am #13893759 | |
Waqar Ali |
Hi Ingrid, First, glad that the issue is resolved and appreciate that you shared your step-by-step findings. They will surely be beneficial to other users facing a similar challenge. Also, thank you for your kind words about our plugins and we'll continue to improve them based on the feedback and suggestions we receive. I've discussed this with my team and to escalate this further we'll need more specific setup details about the theme, template(s), and WPML configuration in use. I will mark this ticket as resolved, but, if you ever happen to get a chance to reproduce this on a test/staging website with a minimal setup, please share it with us, through a new ticket. Wish I could've been of more help in this particular case, but your own troubleshooting has been exceptional. regards, |