Problem/Motivation
In a number of configuration system/configuration schema issue now, the confusing nature of the term "variable value" has come up.
Quoting \Drupal\Core\Config\TypedConfigManager::replaceVariable():
/**
* Replaces variable values in included names with configuration data.
*
* Variable values are nested configuration keys that will be replaced by
* their value or some of these special strings:
* - '%key', will be replaced by the element's key.
* - '%parent', to reference the parent element.
* - '%type', to reference the schema definition type. Can only be used in
* combination with %parent.
*
* There may be nested configuration keys separated by dots or more complex
* patterns like '%parent.name' which references the 'name' value of the
* parent element.
…Steps to reproduce
N/A
Proposed resolution
Rename "variable value" to "dynamic placeholder".
Rename "variable value" to "dynamic type name", since that terminology was +1'd by configuration system maintainer Alex Pott in #2392057: Config schema fails to expand dynamic top-level types. But there's a distinction between the entire dynamic type name and the parts in there that are dynamic. I propose the word "expression", since it must be evaluated.
Remaining tasks
Review.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
N/A
Issue fork drupal-3406487
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
wim leersUse the term
dynamic type names, which #2392057: Config schema fails to expand dynamic top-level types introduced forTypedConfigManager::getDefinitionWithReplacements()'s.
Related: #3392903: Validate inputs of TypeResolver::resolveExpression(): only allow %parent, %type and %key.
Comment #4
wim leersComment #5
wim leersBetter title.
Comment #6
wim leersComment #7
borisson_I agree that dynamic type expression is clearer than variable value. I think this is a good improvement.
Comment #8
phenaproximaI like "dynamic type name" as a consistent term. I also like "expression" to refer to the stuff between square brackets, although we definitely want to be sure we have examples of what "expressions" look like, since it's a more generic word. And indeed, there are already examples in the doc comments we're changing, so...full steam ahead!
Comment #9
phenaproximaCouple minor suggestions but this is light-years better than what's in HEAD. As far as I'm concerned, RTBC once my points are resolved. :)
Comment #10
wim leersDone!
Comment #11
phenaproximaSend it forth!
Comment #12
bircherI was not bothered too much about the old name, but I agree that this is an improvement.
RTBC +1
Comment #13
alexpottLet's preserve BC and add replaceName/Variable back it but trigger deprecations.
Comment #14
wim leersComment #15
wim leersSelf re-RTBC'ing because this is such a trivial change.
Comment #16
alexpottCommitted 2dc7b23 and pushed to 11.x. Thanks!