If we use different prefixes we save/get data from different caches.
We need check the way how prefixes are used to get file configurations.
Every entity that is related with entity should have a suffix "."
config_get_storage_names_with_prefix
core/includes/bootstrap.inc:2456: $language_entities = config_get_storage_names_with_prefix('language.entity');
core/includes/update.inc:1646: $language_entities = config_get_storage_names_with_prefix('language.entity');
core/modules/image/image.install:260: foreach (config_get_storage_names_with_prefix($prefix) as $config_id) {
core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php:47: $mapping_config = config_get_storage_names_with_prefix('rdf.mapping');
core/modules/field/field.install:465: foreach (config_get_storage_names_with_prefix('field.instance') as $config_id) {
core/modules/field/field.install:488: $config_names = config_get_storage_names_with_prefix('field.field');
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | config-prefixes-2162271-interdiff-1-9.txt | 3.83 KB | Anonymous (not verified) |
| #12 | config-prefixes-2162271-9.patch | 7.5 KB | Anonymous (not verified) |
| Screenshot from 2013-12-24 13:06:25.png | 98.59 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) commentedComment #2
Anonymous (not verified) commentedNeeds review in cases:
drush cc all
core/update.php
core/rebuild.php
Comment #3
Anonymous (not verified) commented(10:49:45) chx: likin: $prefix = "field.$type"; line 259
(10:49:54) chx: likin: foreach (config_get_storage_names_with_prefix($prefix) as $config_id) {
...
(11:05:22) chx: core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php
(11:05:23) chx: 745: $ids = config_get_storage_names_with_prefix($config_prefix . '.' . $this->entity_type . '.' . $this->bundle);
...
(11:06:07) chx: likin: core/modules/entity/entity.module is full of this
(11:06:31) chx: likin: http://privatepaste.com/f081d1b26f
...
(11:07:39) chx: likin: look into your config dir. you will see stuff like entity.form_mode.user.register.yml if you list on entity.form_mode.user then say entity.form_mode.userfoo can match
(11:07:48) chx: likin: that's why you need a terminating dot.
Comment #4
Anonymous (not verified) commentedlooks good to me.
Comment #5
chx commentedErm nope. Most of the ones I listed still need fixing.
Comment #6
xjm1: config-prefixes-2162271-1.patch queued for re-testing.
Comment #7
xjmSorry, crosspost.
Comment #9
Anonymous (not verified) commentedComment #10
Anonymous (not verified) commentedComment #11
Anonymous (not verified) commentedComment #12
Anonymous (not verified) commentedComment #13
Anonymous (not verified) commentedok, i actually grep'ed this time, and i can't see any more config_get_storage_names_with_prefix() call sites that don't have the trailing '.'.
so, RTBC for reals.
Comment #14
webchickCommitted and pushed to 8.x, though I can definitely see why people miss this.
Seems like we should have a follow-up to see if we can somehow catch this via automated tests when we forget, or at least make sure it's in the documentation under https://drupal.org/node/1667894.