1

Drupal 8 sometimes displays a warning in site status

Mismatched entity and/or field definitions

There has already been a question about this and the answer is to run drush entity-updates. I can't find any description of a solution directly from the GUI.

I have run the command several times and it works fine. But I don't understand the point of Drupal printing this warning, rather than Drupal solving the problem automatically (by executing whatever the entity-updates command does).

Please can anyone tell me

  1. Is there any analysis that I should do before running entity-updates?
  2. Is there any reason I shouldn't write a cron hook that will call entity-updates automatically?
  3. Should I raise an issue against Drupal core to request that Drupal runs the clean-up automatically rather than printing a warning?
  • 2
    I don't understand the point of Drupal printing this warning, rather than Drupal solving the problem automatically Because it doesn't want to second-guess your development process. You've made changes to code, maybe you're not ready to run the updates yet, Drupal couldn't know. Just like when you create a database update, you have to run the updates for the code to execute. Automatic/inferred updating can be very dangerous for obvious reasons – Clive Jul 25 '17 at 9:54
  • 1
    See this discussion about drush entity-updates drupal.stackexchange.com/questions/221215/… – 4k4 Jul 25 '17 at 10:00
2

Thanks to 4k4 and Clive and following the link I think I can now write up the answer to my question.

  • This Drupal Change Record (and more detail) documents that module developers should write hook_update functions for entity updates. So if you get the "mismatched" warning after a contrib module update then it's a bug in that module and you should not apply to update to the live site.
  • This question explains that entity-updates is a developer tool. If you are a developer working on a test site you may see the "mismatched" warning whilst making changes. You will run entity-updates when you are ready.

So the answer to my questions 2 and 3 is no.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.