Menu names use hyphens, but most other machine names use underscores. We should decide on a standard.

If we can standardize on machine names, then we can also standardize on token names, see #1302056: Standardize on use of underscore vs hyphen in tokens

CommentFileSizeAuthor
#6 menus-hyphens.JPG51.23 KBericyellin

Comments

jenlampton’s picture

Tagging for learnability :)

eojthebrave’s picture

I think we should standardize on underscores rather than hyphens as hyphens do to translate nicely to PHP variable or function names.

dawehner’s picture

Issue summary: View changes
Status: Active » Fixed

Afaik we have standardized on underscores now.

Status: Fixed » Closed (fixed)

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

dreftymac’s picture

ericyellin’s picture

StatusFileSize
new51.23 KB

This still seems to be an issue on Drupal 8.5.4 release.
It seems that only menus use hyphens while everywhere else underscores are used.
This causes issues with modules that expect underscores and disallow hyphens.
Also had an issue with menus that were created with underscores (maybe an older version with no validation) and now cannot be edited and saved since while saving it validates and prevents underscores.
This is not fixed... See screenshot.

Menu Hyphens

ericyellin’s picture

This still seems to be an issue on Drupal 8.5.4 release.
It seems that only menus use hyphens while everywhere else underscores are used.
This causes issues with modules that expect underscores and disallow hyphens.
Also had an issue with menus that were created with underscores (maybe an older version with no validation) and now cannot be edited and saved since while saving it validates and prevents underscores.
This is not fixed...
Here is the mesa
Menu Hyphens

bdanin’s picture

I'm having this same issue with menus in Drupal 8.7.3

I have old menus installed from a previous version and all the machine names are using underscores. However, if I add a new menu to the site it uses hyphens now by default. And when trying to edit an existing menu, I'm getting the same errors shown in previous comments meaning I can't re-order menus through the UI, only directly in code with config-management. Why do menus use hyphens, see this thread for example: https://drupal.stackexchange.com/questions/206067/use-underscores-in-men...

This is a major issue in my opinion and menus should use underscores like before and the rest of Drupal machine names.

anruether’s picture