Add an option to machine name elements to increment with a delta instead of failing validation

Created on 14 June 2013, over 11 years ago
Updated 3 February 2025, 1 day ago

Updated: Comment #0

Problem/Motivation

Machine names are by their nature unique, so they typically have validation to ensure a duplicate machine name does not already exist. However, when the machine name is auto-generated based on another field, the user might sometimes create a duplicate machine name without knowing the machine name field even exists. This causes a usability problem when the user is suddenly confronted with an error on a field they've never seen before.

For example, in the field UI:

  1. Install 8.x standard.
  2. Go to admin/structure/types/manage/page/fields.
  3. Under "Add new field," type "tags" in the Label field and select a term reference field.
  4. You receive a validation error on a field you did not fill in.

Proposed resolution

Make the machine name element provide the option to automatically append a delta.

Remaining tasks

  • Choose an approach.
  • Create patch.
  • Update existing machine names in the block and field UIs to use the auto-delta.
  • Remove the custom delta generation from the views block plugin.

Related Issues

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

forms system

Created by

πŸ‡ΊπŸ‡ΈUnited States xjm

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • VDC

    Related to the Views in Drupal Core initiative.

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024