Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
- The
'source'
element of#type 'machine_name'
defaults to'name'
, but the new Configurables in D8 are standardized on'label'
.
Details
- Machine names are primarily (or even exclusively?) used for Configurables.
Proposed solution
- Change default to 'label'.
- Adjust all implementations that are not Configurables yet.
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal8.machine-name-label.3.patch | 5.1 KB | sun |
#1 | drupal8.machine-name-label.1.patch | 5.11 KB | sun |
drupal8.machine-name-label.0.patch | 1.3 KB | sun | |
Comments
Comment #1
sunAttached patch adjusts all #machine_names throughout core, as necessary.
So this issue is done.
Comment #3
sunRe-rolled against HEAD.
Comment #4
andypostAll places are covered
Comment #5
webchickThat makes sense to me.
Committed and pushed to 8.x. Thanks!
Comment #6
tstoecklerActually, I don't think this change was correct. To quote Bojhan in #1043198-74: Convert view modes to ConfigEntity:
If I understood him correctly, the "objects" he speaks of, are ConfigEntities in developer-speak, which in turn are the major use-case for #machine_name's.
Maybe someone should ping him about this.
In the end, this is just a default, so I don't feel strongly, but I thought it would warrant re-opening this.
Comment #7
sunI think the remark about usage of label is obsolete by now, due to EntityInterface::label().