- First commit to issue fork.
- @sayan_k_dutta opened merge request.
- 🇮🇳India sayan_k_dutta
The patch in #11 solves the problem. Both underscores and hyphens are now applied to menu machine names. By default, as a replacement underscores are applied, inline with the naming convention of other machine names. Created MR !11592 for the same.
The screenshots are attached below after testing on my local:
Need others to review.
- 🇮🇳India sayan_k_dutta
@mrdalesmith, works perfectly and passing all tests. You can move it to RTBC.
- 🇬🇧United Kingdom longwave UK
I traced the history of this regex all the way back to #147656: Menu module for D6 → where it was first introduced. I could not find any discussion of why menu machine names could only contain hyphens and not underscores.
However, this could do with additional test coverage to ensure that menu names with underscores can be successfully created and used, and to prevent this from being removed again in the future.
- Status changed to Needs review
8 days ago 12:15pm 7 May 2025 - 🇮🇳India snehal-chibde
Hello, I have tested the MR on Drupal 11.x-dev, It is working as expected. We can now have _ in machine name.