Problem
- Many (core) developers did not notice that the config_prefix of config entities does NOT contain a trailing dot and forgot it when listing/querying for all available config object names within a config-prefix namespace.
- Omitting the trailing dot can very/too easily lead to false-positives. Essentially a very similar problem space we have with module hook implementation names already; e.g.,
foo_bar_baz()can be foo's hook implementation ofhook_bar_baz(), but also foo_bar's hook implementation ofhook_baz().
Proposed solution
-
No change to existing entity type meta-data/annotations.
-
Make the entity plugin manager perform this:
// Ensure that config_prefix ends with a trailing dot. if (isset($definition['config_prefix'])) { $definition['config_prefix'] = rtrim($definition['config_prefix'], '.') . '.'; } -
Change all callers/actors that operate on config_prefix directly to remove the additional/custom futzing with a trailing dot.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | drupal8.config-prefix-dot.do-not-test.patch | 5.66 KB | sun |
Comments
Comment #1
sunHrm. Grepping for config_prefix...
1) reveals how utterly apparent the awareness problem of a trailing dot is.
2) reveals that all usages that want to load the actual manifest file would have to strip the trailing dot again.
Suggestions?
I did not touch all instances. Left a range of comments instead.
Comment #2
sunComment #3
tim.plunkettWhich bug?
This whole method seems to become irrelevant.
O_o
Comment #4
alexpott#1849792: Abstract usage of 'config_prefix' on ConfigStorageController into getConfigPrefix method has solved this