After clicking on "finish" I have a critical error on the screen.
In the log:
2022/05/12 14:07:28 [error] 3669737#3669737: *6206 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:495 the database contains post_attachment while this function was called with post_nav_menu_item in
The website is in german and needs to be translated in english (sub-folders).
Is there any documentation that you are following?
I was following the wizard from WPML..
What is the link to your site?
hidden link
After clicking on "finish" I have a critical error on the screen.
In the log:
2022/05/12 14:07:28 [error] 3669737#3669737: *6206 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:495 the database contains post_attachment while this function was called with post_nav_menu_item in /var/www/clients/client251/web1417/web/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:34
Stack trace:
#0 /var/www/clients/client251/web1417/web/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1515): WPML_Set_Language->set()
#1 /var/www/clients/client251/web1417/web/wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/class-wpml-nav-menu.php(214): SitePress->set_element_language_details()
#2 /var/www/clients/client251/web1417/web/wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/class-wpml-nav-menu.php(82): WPML_Nav_Menu->_set_menus_language()
#3 /var/www/clients/client251/web1417/web/wp-includes/class-wp-hook.php(307): WPML_Nav_Menu->init()
#4 /var/www/clients/client251/web1417/web/wp-includ" while reading response header from upstream, client: 37.24.244.89, server: ocean.test-umgebung.de, request: "GET /wp-admin/admin.php?page=tm/menu/main.php HTTP/2.0", upstream: "hidden link:", host: "ocean.test-umgebung.de", referrer: "hidden link"
2022/05/12 14:07:31 [error] 3669737#3669737: *6206 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:495 the database contains post_attachment while this function was called with post_nav_menu_item in /var/www/clients/client251/web1417/web/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:34
Stack trace:
#0 /var/www/clients/client251/web1417/web/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1515): WPML_Set_Language->set()
#1 /var/www/clients/client251/web1417/web/wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/class-wpml-nav-menu.php(214): SitePress->set_element_language_details()
#2 /var/www/clients/client251/web1417/web/wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/class-wpml-nav-menu.php(82): WPML_Nav_Menu->_set_menus_language()
#3 /var/www/clients/client251/web1417/web/wp-includes/class-wp-hook.php(307): WPML_Nav_Menu->init()
#4 /var/www/clients/client251/web1417/web/wp-includ" while reading response header from upstream, client: 37.24.244.89, server: ocean.test-umgebung.de, request: "GET /wp-admin/admin.php?page=tm/menu/main.php HTTP/2.0", upstream: "hidden link:", host: "ocean.test-umgebung.de", referrer: "hidden link"
Backend is broken, so I cannot paste the debug information.
The website is using Avada (current version). WordPress ist current verison and WPML was installed using the new installer
The error is not only with translate everything.. what ever I try, when I finish the wizard, there is a crititcal error display and the backend is no more available.
In the logs it is the same error.
I have made many other tries in between, all with the same error as result:
- translate everything / translate some
- language as sub folder, language as sub domain
- install a version from january 2022 (4.5.3)
- activate a standard theme before starting wizard (twentytwo)
Let's try some possible solutions to see if this gets corrected:
**IMPORTANT** - Please make a backup of the site files and database before doing the following procedures:
#1 If you can still access your WP Dashboard:
- Go to WPML -> Support
- Click on the Troubleshooting link
- Click on the Fix post type assignment for translations button
#2 If you can’t access the WP Dashboard or the steps above do not help:
- Get access to your database using phpMyAdmin (or any other similar tool)
- Go to the wp_icl_translations table
- Find the entry with element_id:495 and delete that row
It might be necessary to replicate this workflow a couple of times until the issue is fixed.
Please give those instructions a try and let us know how they go. We're looking forward to your reply. Thanks!
Kind regards,
Mateus.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.