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 8 replies, has 2 voices.
Last updated by Bobby 1 year, 1 month ago.
Assisted by: Bobby.
Author | Posts |
---|---|
October 3, 2023 at 1:05 pm #14504925 | |
olgaS-13 |
Tell us what you are trying to do? I'm trying to use the Synchronize Menus functionality. After reviewing the suggested changes and accepting them, the site has a fatal error because the database contains an invalid entry. Using the information from resolves the problem, but the next time I try to synchronize the menus, the problem reappears exactly as before Is there any documentation that you are following? https://wpml.org/errata/fatal-error-invalidargumentexception-element_id-and-type-do-not-match/ Is there a similar example that we can see? What is the link to your site? hidden link |
October 4, 2023 at 4:53 am #14509401 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Hi there, First make sure to have debug display activated that way when the fatal error happens you are able to see the ID number triggering the error. Then allow this fatal error to happen and go to your database. Access to your database. Once done refresh the page with the fatal error and check if the ID now changed, if it did repeat the steps above until done. when this happens with menus -- the more menu items there is the more times you will need to repeat with different ids. Another workaround could be to re create your menu from scratch (delete and re do), however, I only would recommend this if you have a simple and small menu. Let me know your results, please. |
October 4, 2023 at 11:57 am #14512777 | |
olgaS-13 |
I can repair the database as I said. The problem is that every time I try to use the menu synchronization feature it is again corrupted. See the following snippet from the log (WordPress debug.log) [03-Oct-2023 12:34:15 UTC] PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:14284182 the database contains post_attachment while this function was called with post_nav_menu_item in /www/htdocs/aufwind/inc.aufwind.co.at/wp-content/plugins/old_sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:34 There you can see the fatal error with ID 14284182, then I fixed the database as described in the article (not visible in the log file), the I tried again to synchronize the menus and finally you can see the fatal error with ID 14284183. Therefore I conclude that the synchronize menu feature creates a corrupt database entry in a reproducible manner every time I try to use it with the project. Since the project was done by someone else and we are currently "only" adding the translation, we would prefer not to redo the menus. BTW the menus are created with DonDivi DiviMenus (hidden link) |
October 4, 2023 at 8:53 pm #14515665 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
I would like to request temporary access (wp-admin and FTP) to your site to test the issue. **Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken ** I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/ NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin. Thank you, |
October 7, 2023 at 4:33 am #14531881 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Thank you for the access details! I was able to run the troubleshooting actions in WPML->Support->Troubleshooting Remove the menu and successfully re-add it and synchronize it. Let me know your results, please. |
October 10, 2023 at 12:47 pm #14550035 | |
olgaS-13 |
Hi Bobby! Thanks for your help! I notice that the language switcher only works on certain pages. Also, in the synchronized menus, there are only about 4 entries, whereas on the page there are many more menu items. Are these problems connected? How can I synchronize the menus competely? Or do you suggest some other method to make the language switcher work on every page? Something else I noticed is that the pages' translation does not seem to accept the completed state. Although I told it to "Finish and Verify" the translation after inputting a translation for each text, I continue to see the "gear" icon instead of a "checkmark" icon for the english translation in the pages view. |
October 10, 2023 at 8:19 pm #14553671 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Hi there, When reviewing your pages I noticed the following: Go to pages-> notice the "gear" icon This means that your translation is in progress, when a translation is in progress it will not be available for visitors to see in the front end. This is causing the language switcher to not display or work as expected between languages that are missing the translation. Also, if a page/post is not translated the menu item won't be available To resolve: Click on the gear icon and fully finish the translation (make sure to get it to 100% and save) Let me know your results, please. |
October 11, 2023 at 8:42 am #14556799 | |
olgaS-13 |
Hi, this is what I try to do: Click the gear icon of a page (or other resource that needs a translation). Input the translation until everything is translated (progress bar ist at 100%). Click the "Abschließen" (Complete) button. I'm returned to the pages overview an see the turning arrows icon forever. When I finally reload the pages (because nothing happened for minutes) the gear icon is there again. Pages I tried are e. g. "Datenschutz", "Home". For "Kontakt", "Kontakt" and "Impressum" and the remaining pages it worked, but then I also had "Datenschutz" finished (pen icon) in the past but for some reason it returned to "gear icon" for no obvious reason. What am I doing wrong? Is there some setup problem? As you write, the process should be simple enough. As a side question: Is there a possibility to preview a page when the translation is not yet complete? Like sometimes a translation requires the URL (or relative link) to a page that is not yet translated, but I'd like to review the translation in the original layout anyway. Currently I mark those texts as translated even though they really aren't and have to keep track of these open issues manually. This doesn't seem perfect to me. |
October 12, 2023 at 12:18 am #14562067 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Thank you for updating me! To answer your side question first, when you first add a translation to a page it needs to be at 100% before you can view it as it is in progress, and does not "exist" yet. You can always go back and edit the specific areas if you need to change a URL. Please go to WPML->support->troubleshooting->syncrhonize local job ids with ATE jobs then re try to translate the page and let me know your results, please. |
October 18, 2023 at 3:09 pm #14606277 | |
olgaS-13 |
I re-saved the mentioned pages and was then able to finish the translation. |