Hide machine-name-suffix field

Created on 26 March 2025, 11 days ago

Problem/Motivation

There is extra space in the form when adding sub-fields, in each one. It looks like an empty helper element?

<small id="edit-label-machine-name-suffix">&nbsp;</small>

Steps to reproduce

Adding sub-fields, and see that extra space makes the form longer.

Proposed resolution

Hide the   with CSS?

Remaining tasks

Decide if hiding it with CSS is the right approach -- or, if it's actually used in some situations, it should only be shown then.

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

3.1

Component

Code

Created by

🇩🇰Denmark ressa Copenhagen

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

Merge Requests

Comments & Activities

  • Issue created by @ressa
  • 🇩🇰Denmark ressa Copenhagen
  • 🇺🇸United States apmsooner

    This machine name suffix is a core thing i guess and I do believe there's a bug in core with multiple machine name fields in the same form. I think we could track down a core issue for this and fix it there, then it should get reflected here. Thats why the first field acts like a typical machine name field and the subsequent fields look different. I assume theres some javascript involved in core that needs some attention.

  • 🇩🇰Denmark ressa Copenhagen

    Thanks for clarifying, do you think it can be hidden with CSS, if from the perspective as a user, it is never relevant anyway?

  • 🇺🇸United States apmsooner

    It shouldn't be hidden, it should be fixed in core. The suffix is what contains the label and edit button in place of the input field. The javascript appears to faulty on that core element which is causing an empty suffix.

  • 🇺🇸United States apmsooner

    I think its ultimately because these new elements are being added via ajax though and the javascript for the machine name field is not acting right perhaps after the ajax trigger. I will look deeper into this when i get a chance to see if i can figure out where its getting lost as I agree with you that the presentation is not desirable and consistent.

  • 🇩🇰Denmark ressa Copenhagen

    Sounds great, thanks. @lavanyatalwar: I am unassigning you, since @apmsooner will take a deeper look at this ... or perhaps you want to take a closer look as well?

  • 🇺🇸United States apmsooner

    @ressa,

    I've removed the javascript aspect from this machine name type field as its just not really working right particularly with the dynamic parts of this form. This just always exposes the name field for all of them and eliminates the empty suffix that was causing unwanted space. Try the patch please and add a review.

    Thanks!

  • 🇩🇰Denmark ressa Copenhagen

    Perfect @apmsooner, this is so much better, killing three birds with a single stone. It works perfectly, thanks!

  • Pipeline finished with Skipped
    10 days ago
    #458668
    • apmsooner committed ad825451 on 3.1.x
      Issue #3515457 by apmsooner, ressa: Streamline machine-name handling
      
  • 🇺🇸United States apmsooner
Production build 0.71.5 2024