There's a minor glitch when adding a new field and changing the machine name...
1) Enter a 'Label' in the 'Add new field' row.
2) Edit the automatically generated machine name.
3) Drag the 'Add new field' row to another location.
The machine name disappears! It does save properly, but before that you can't see what you entered or edit it again.

A workaround is to move the field before editing the machine name. But users shouldn't be expected to know that.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SeanA created an issue. See original summary.

walangitan’s picture

This patch moves the hide function on the wrapper of of the input field into the conditional for that field to being empty. The assumption that is made is that the field will always be empty until the javascript starts to copy values into it from the transliterated field. Before, it hidden by default and my understanding is that dragging the element reset it to the default behavior. This patch should resolve that behavior.

walangitan’s picture

Status: Active » Needs review
SeanA’s picture

Status: Needs review » Needs work
FileSize
14.56 KB

It works, after editing the field doesn't disappear when dragging. However, if you then try to save the new field without selecting a type or widget, when the page reloads with the form error, the machine name preview and edit link appears again.

SeanA’s picture

Status: Needs work » Needs review
FileSize
3.03 KB

This patch moves the preview and edit link into the conditional statement as well, so they won't show if the machine name has already been edited.

poker10’s picture

It is possible that this is a duplicate of this issue: #1700210: After editing a field machine name, then re-ordering the field, machine name field disappears? In that issue the approach used in D8 seems to be a lot easier.

poker10’s picture

poker10’s picture

I think that the patch from the #5 of the parent issue should be better, because it is really simple and should fix the problem (according to my testing). Please test the patch, we do not have tabledrag JS tests in D7.

mcdruid’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +RTBM

I tested this manually and can confirm the bug and the backported fix in #8.

Thanks for the clear steps to reproduce, and for tidying up the loose ends with the backport.

  • poker10 committed 64aa502 on 7.x
    Issue #2649926 by SeanA, poker10, walangitan: [D7] Field UX: machine...
poker10’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs manual testing, -RTBM

Thanks all!

Status: Fixed » Closed (fixed)

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