- Status
- Resolved
- Reported for
- WPML Multilingual CMS 4.4.10
- Resolved in
- WPML 4.6.7
Overview of the issue
A blank screen appears and after enabling debug mode, the following error appears in some configurations:
PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match in wp-contentpluginssitepress-multilingual-cmsclassescore-abstract-classesclass-wpml-set-language.php on line xx
These kinds of exceptions were hidden from the user in the previous version. In the long run, however, they might lead to database corruption and we have decided to no longer hide them. Starting from WPML 3.3.5, such exceptions are thrown to allow users to spot the issue immediately. This will make fixing issues with corrupted settings much easier, since they can be caught in their early stage.
Issues may look different on different installations. The issue may:
- Appear in WPML admin pages.
- Make it impossible to access the Plugins page.
- Occur on WPML (or its add-ons) activation only.
- Occur when posts are being saved.
A blank screen appears in every case, with the error appearing with debug mode enabled.
Workaround
Please, make a full backup of your site before proceeding.
If you can still access to your Dashboard:
- Go to WPML → Support.
- Click on the Troubleshooting link.
- Click on the Fix post type assignment for translations button.
- You may need to click on the Remove ghost entries from the translation tables button.
If you can’t access or it does not help:
- Access to your database.
- Open the wp_icl_translations table.
- Search for the element_id which is throwing the error.
- Delete the row.
You might need to repeat the workflow several times until the issue is fixed.