Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293442

Make config_prefix always contain a trailing dot

$
0
0

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 of hook_bar_baz(), but also foo_bar's hook implementation of hook_baz().

Proposed solution

  1. No change to existing entity type meta-data/annotations.

  2. Make the entity plugin manager perform this:

    <?php
    // Ensure that config_prefix ends with a trailing dot.
    if (isset($definition['config_prefix'])) {
     
    $definition['config_prefix'] = rtrim($definition['config_prefix'], '.') . '.';
    }
    ?>
  3. Change all callers/actors that operate on config_prefix directly to remove the additional/custom futzing with a trailing dot.


Viewing all articles
Browse latest Browse all 293442

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>