Drupal 8 "Mismatched entity and/or field definitions"

Updating modules in Drupal 8 is similar to updating modules in Drupal 7 - the drush pm-update (drush up) command still works, but there's a new "gotcha" that you need to look out for when updating modules that work with entities. 

Sometimes, after updating modules that interact with entities, you'll see a "Entity/field definitions: Mismatched entity and/or field definitions" error on your site's status report (admin/reports/status). 

"Mismatched entity and/or field definitions" error

In the screenshot above, this error was generated by updating the Inline Entity Form module from its alpha4 version to the most recent -dev version (the site also uses the Scheduled Updates module). As long as a mismatch is present, the fields listed in the error will lead to unpredictable results.

Neither rebuilding caches nor running cron will fix this issue ("drush up" doesn't automatically run this command either) - for these types of errors, the drush entity-updates command is what you're looking for.

Once this command is run, your status report will look something like this:

Clean status report

This is just one more reason why checking your site's status report page after updating modules is always a good idea. 

 

I've indeed run into this problem with pathauto in Drupal 8. However, I'm developing in a Windows environment. Is there a way to resolve these mismatch situations without the use of drush?

Submitted by zoondev (not verified) on Thu, 03/03/2016 - 11:38

Hi Mike, this is great, and I have no problem using drush, but it seems to me as a matter of principle that there should be a file like update.php to run to fix these issues. I have been Googling around all morning and can't seem to find any info where this is being contemplated.

Submitted by Robert Kopacz (not verified) on Sun, 03/06/2016 - 08:08

Is there any way of fixing this without using Drush? I added an update script to Metatag to fix it after the module added a config entity, but that lead to other problems (https://www.drupal.org/node/2671194).

Submitted by Damien McKenna (not verified) on Thu, 03/10/2016 - 10:31

It worked for me :)

Submitted by Farliec (not verified) on Mon, 04/04/2016 - 18:18