While installing and Uninstalling Modules of Drupal 8 - using the Migrate tool I came across this issue.
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
AND THEN YOU GET A LIST
Something like
I have found two solutions for this , depending on whether this is a mismatched entity or field definition. So I will list both . Make sure you have a full backup of your site before you try these.
For Entity mismatches - what we need
to do is cleanly remove our Modules, but cannot use the normal way as it gives us an error.
Here's a lazy one liner.
drush eval "\$module_data = \Drupal::config('core.extension')->get('module'); unset(\$module_data[‘company’]); \Drupal::configFactory()->getEditable('core.extension')->set('module', \$module_data)->save()";
Here the module is called 'company' , you would swap that out for what you wish.php ../vendor/drupal/console/bin/drupal cache:rebuild
And when you've checked the site and are happy we should Export our new configuration
php ../vendor/drush/drush/drush cex
FIX the FIELD DEFINITION
That fixes all but the 'Name' field needs to be updated bug.
For this I had to install this module
run composer
Now in the container Enable the module .
drush pm:enable devel_entity_updates
|
And run the 'entup' command.
drush entup
Here are some additional notes that I made while looking for this solution; that may help others find this article.
I attempted to use updateFieldStorageDefinition(FieldStorageDefinitionInterface $storage_definition);
What is the storage_definition for our field
Drupal 8 get The field storage definition
Drupal 8 Errors found Entity / field definitions the % field needs to be updated hook_update_N getFieldStorageDefinition
Fix Drupal 8 The % field needs to be updated. hook_update_N issue