Strip useless "_" at beginning and end of JS-transliterated machine names

Created on 17 June 2012, over 12 years ago
Updated 6 July 2023, over 1 year ago

Problem/Motivation

Machine names are created from labels in the UI using JavaScript. There are many places in the Drupal admin UI, where this is used, for example when creating Entity types, blocks or in contrib modules (Rules, Asset Injector, ...).

All unsupported chars in the label are replaced by "_" for the machine name. Quite often, the label may contain characters like brackets at the end. For example if the label is used to add details, like "Node Type A (aka B)" ends up in machine name: node_type_a_aka_b_

Steps to reproduce

See above

Proposed resolution

Having a machine name finishing with "_" is just weird. Remove the trailing "_"

The original creator of the issue provided a patch to fix that.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

āœØ Feature request
Status

Fixed

Version

11.0 šŸ”„

Component
FormĀ  ā†’

Last updated 1 day ago

Created by

šŸ‡«šŸ‡·France nod_ Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024