Home›Support›English Support›[Resolved] InvalidArgumentException: element_id and type do not match for element_id:
[Resolved] InvalidArgumentException: element_id and type do not match for element_id:
This thread is resolved. Here is a description of the problem and solution.
Problem: There is an error when activating WPML InvalidArgumentException: element_id and type do not match for element_id:62369 the database contains post_product_variation while this function was called with post_product in /wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:32
I corrected the Attribute slug character limitation problem manually on all slug where the string was too long. It was a very long process.
After that I'm tried to activate the wpml main addon (WPML Multilingual CMS) but the WP crashed with details:
2019-06-16T18:02:46+00:00 CRITICAL Uncaught InvalidArgumentException: element_id and type do not match for element_id:62369 the database contains post_product_variation while this function was called with post_product in /var/www/vhosts/koukosmarine.gr/httpdocs/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:32
Stack trace:
#0 /var/www/vhosts/koukosmarine.gr/httpdocs/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1484): WPML_Set_Language->set('62369', 'post_product', NULL, 'el', NULL, true)
#1 /var/www/vhosts/koukosmarine.gr/httpdocs/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(1888): SitePress->set_element_language_details('62369', 'post_product', NULL, 'el')
#2 /var/www/vhosts/koukosmarine.gr/httpdocs/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(1858): TranslationManagement->add_missing_language_to_post(Object(stdClass))
#3 /var/www/vhosts/koukosma in /var/www/vhosts/koukosmarine.gr/httpdocs/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php on line 32
After that I entered to the backend in recovery mode and disbaled the wpml plugins again.
this is a relatively common error that happens when some entries in the database are corrupted. This may be caused by a different number of factors, like updating or installing new plugins or doing operations on the database. Since you went through heavy changes in your site, it can be related to that.
You can try the troubleshooting options in WPML -> Support -> troubleshooting and see if they fix the issue (please do a backup before).
If they don't help, you'll need to operate on your database:
- do a backup
- with PHPMyAdmin or another database manager open the table wp_icl_translations
- search for element_id:62369
- verify what it is (should be a product, but maybe a copy)
- delete it
This should fix the issue.
Let me know if this helps you or if you need further assistance.
Hi,
The record with element_id:62369 is "post_product_variation" and is probably related with the corrections that I made in the database.
In the WPML Troubleshooting page I can see that slugs (many of my corrections) in "Translatable taxonomies linking" is not linked with the Attribute that should be connected.
Is there any way to mass re-link these or fix the translation table for all the problematic translation?
PS: with all the errors, the whole WP is crashing or very slow. It is not an ideal environment to make editing or corrections from it.