Skip Navigation

Open

Reported for: WPML Multilingual CMS 4.4.10

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-content\plugins\sitepress-multilingual-cms\classes\core-abstract-classes\class-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

If you can still access to your Dashboard:

  1. Go to WPMLSupport.
  2. Click on the Troubleshooting link.
  3. Click on the Fix post type assignment for translations button.

If you can’t access or it does not help:

  1. Make a full backup of your site.
  2. Access to your database.
  3. Open the wp_icl_translations table.
  4. Search for the element_id which is throwing the error.
  5. Delete the row.

You might need to repeat the workflow several times until the issue is fixed.

15 Responses to “Fatal error: InvalidArgumentException: element_id and type do not match”

    • Hello Gustavo,

      This issue was fixed in WPML 3.3.6 and everything should work in the 3.3.7 beta version as well. Could you please report the issue using the support forum? There, we will be able to provide faster and better support, adjusted to your specific case – something we can’t do via these comments.

  1. Hello i’m using WPML Multilingual CMS 4.5.1 in a fresh new installation and i’m experiencing a lot of wpml-cms issues.

    I almost ever experienced from this october this kind of issues until it was broken in unknow way ( gave error 500 on every i18n’s page load). It was impossible to migrate it safely and was very strugglying to debug.
    I guess wpml auto upgraded itself but then trying to solve i updated, reinstalled, upgraded but nothing worked.

    At the end i reinstalled in a separate fresh env to and i’m experiencing this kind of issue without even having ever used it.

    Is this a stable product or to use it is only a big waste of time?

    • Hello there,

      I’m sorry for your experience. However, WPML does not upgrade automatically, it needs to be approved by an user with those rights.
      Regarding this error, if after applying the fix proposed in this article the issue remains, please open a ticket in our support forum so we can help you better as we don’t have the right debugging tools here.

      Regards

  2. Yes thank you.

    1) increase the WordPress Memory Limit
    2) Fix post type assignment for translations under the Support Page | i had 290 issue fixed.

    Originally, i want to rebuild the site. Now is OK.

    Thanks a Lot

  3. hello
    i cant understand what to do and how to do it.
    i have problem with my both websites,
    can you help me please ?

    thanks

    • Hello @tawfiqM,

      If you are having issues applying any of those workarounds, please open a ticket in our support forum where one of our specialists will guide you through this process.
      Regards

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>