- 🇨🇦Canada dadderley Vancouver
I took over some sites that had been migrated from drupal 7 and there were all kinds of relics left over from the migration.
This has been vexing for a long time.My dblog reports were polluted with errors like this:
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: taxonomy_term, bundle: migrate_example_wine_varieties, field name: field_variety_attributes
I followed your well written instructions and now the dblog page is free from these stupid errors.
Thank you rex.barkdoll!
- 🇺🇦Ukraine vlad.dancer Kyiv
We used code from #27 and deleted all weird things.
But I would also reccomend that if "bundle_field_map" ($map) is empty after unsetting:$field_map_kv_store = $key_value_factory->get('entity.definitions.bundle_field_map'); $map = $field_map_kv_store->get($entity_type); // Remove the field_dates field from the bundle field map for the page bundle. unset($map[$field_name]['bundles'][$bundle]); $field_map_kv_store->set($entity_type, $map);
then it is better to remove such record:
if (empty($field_map_kv_store->get($entity_type))) { $field_map_kv_store->delete($entity_type); }
Alternatively/additionally I would recommend to search key_value table for leftovers:
SELECT `collection`, `name`, `value` FROM `key_value` WHERE `name` LIKE '%comment%' LIMIT 0,1000;
Like:state comment.maintain_entity_statistics b:1;
- 🇳🇱Netherlands Gerard Benimeli
Thank you @rexbarkdoll #74 worked for me and indeed this was my first module ever.
- 🇺🇸United States butterwise
I, too, inherited a site that was migrated from D7 to D9 which was plagued by a couple of these annoying errors. Thank you, @rex.barkdoll, for the thorough and easy to understand instructions. Worked like a charm!
- 🇲🇽Mexico koffer
I get some problem with a site migrated from Drupal 7 to Drupal 9 then to Drupal 10. I get a lot of error message about comments fields
Error like:
Field comment.comment_node_article.comment_body exists but is missing a corresponding field definition and may be misconfiguredI fix it creating a new field for comments and refreshing cache.
- 🇨🇭Switzerland Lukas von Blarer
I improved the approach in #60 a bit:
function MODULE_update_9501() { $fields = [ [ 'entity_type' => 'node', 'bundle' => 'bundle_name', 'field_name' => 'field_name', ], ]; foreach($fields as $field){ /** @var \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory */ $key_value_factory = \Drupal::service('keyvalue'); $field_map_kv_store = $key_value_factory->get('entity.definitions.bundle_field_map'); $map = $field_map_kv_store->get($field['entity_type']); // Remove the field_fpimage field from the bundle gallery_assist for the page bundle. unset($map[$field['field_name']]['bundles'][$field['bundle']]); $field_map_kv_store->set($field['entity_type'], $map); } }
- 🇺🇸United States jrwest_webguy
#74 was very helpful for me as well. Thank you @junaidpv and @rex.barkdoll.
- 🇺🇸United States kmcgill7 Georgia
#74 was the perfect roadmap. Thanks to @junaidpv and @rex.barkdoll for the details.
- 🇮🇷Iran amir jamshidi
#74 💬 How to fix "non-existent config entity name returned by FieldStorageConfigInterface::getBundles()" Needs work worked for me. thanks
- 🇺🇸United States mlncn Minneapolis, MN, USA
This comes up on so many sites we inherit as rescues of attempted migrations, so added the work from this issue to Migration Helpers module → as a few functions available ✨ Add helpers to remove leftover field storage config Needs review to use in an update hook or a deploy hook (not drush, at the moment anyway).
If there are safe-ish ways to automatically remove invalid configurations from entity definitions bundle_field_map i would happily experiment with them there.