I'm stuck in a loop. The Drupal 9.3 status page shows the following error:

Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
The paragraph.field_heading field needs to be updated.

But when I run "drush entup" I get the below error. I have a lot of data in the mentioned field so I can't delete the field. How did this mismatch happen and why can't entup resolve it?

EDIT: Issue resolved. I had used this article to change a field's length and had missed the last line that saved the config.

enter image description here

  • 1
    The messages says you need an update hook migrating the data. Since the module for the entity type Paragraphs provides update hooks for schema changes the problem is probably caused by the field definition. How is the field defined and what changed before the error?
    – 4k4
    Jan 8 at 14:53
  • I'm not sure what you mean by "How is the field defined?" - it's a plain text field used on several Paragraph entities. I've re-saved the fields and Paragraphs everywhere the field is used without any change in the error. Jan 8 at 22:30
  • You mean the core plain text field type, the field name is shared between different paragraph types and you are trying to re-save the field settings of paragraph types? Then this is the same as in a content type and is not paragraph specific. But why are people using plain text fields all the time without a schema mismatch? There has to be something special in your case, for example did you try to change the text field length?
    – 4k4
    Jan 9 at 9:48
  • Ahhh, I did change the text field length. Wow, I forgot about that. With this new information do you have any suggestions on how to fix the error? Jan 9 at 16:27

With this new information do you have any suggestions on how to fix the error?

This schema mismatch in a plain text field doesn't normally happen. You can't change the maximum length in UI, it's not allowed if the field contains data. And you can't import a modified field storage definition, this throws the same error as above and stops the import. So it's unclear how you did this, but the fix is then to use the same way to change it back.

Why can't entup resolve it?

See https://www.drupal.org/project/devel_entity_updates

  • Thank you, I found my original documentation and the article with the update hook code to change a field length. I found an issue in the code, fixed reran the update hook and the issue is resolved now. 1 hour ago

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.