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

  1. Change default to 'label'.
  2. Adjust all implementations that are not Configurables yet.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Attached patch adjusts all #machine_names throughout core, as necessary.

So this issue is done.

Status: Needs review » Needs work

The last submitted patch, drupal8.machine-name-label.1.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
FileSize
5.1 KB

Re-rolled against HEAD.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

All places are covered

webchick’s picture

Status: Reviewed & tested by the community » Fixed

That makes sense to me.

Committed and pushed to 8.x. Thanks!

tstoeckler’s picture

Status: Fixed » Active

Actually, I don't think this change was correct. To quote Bojhan in #1043198-74: Convert view modes to ConfigEntity:

Can we change "Label" to "Name". This is a unwritten and not consistently applied rule, but for adding "objects" we tend to use the label "Name" - see content type for these kind of config objects.

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.

sun’s picture

Issue summary: View changes
Status: Active » Fixed

I think the remark about usage of label is obsolete by now, due to EntityInterface::label().

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.