-
Notifications
You must be signed in to change notification settings - Fork 40
Description
This "bug" most likely applies to other forms as well, but I found it while testing things out with form validation in the layout add form (admin/structure/layouts/add)...
-
Head to that form and without entering any value in any field or selecting any template, scroll down to the form submit buttons and hit the "Create layout" button. You get a series of validation errors including one for the machine name and that field is presented to you in edit mode with red border:
...at this point, the user looses the auto-generation functionality of the machine name and there is no way to get it back (other than a page refresh of course but that is not the point).
-
Now, refresh the page (so you get rid of the validation error messages) but instead of hitting the "Create layout" button, click the "+ Add visibility condition" link (still not filling in any fields in order to trigger the validation errors). Because of the fact that this link does not cause a page refresh ([UX] On the Add layout form, move "path" and "visibility conditions" above the template icons. #1606), you'll have to scroll back up to the top of the page in order to see the validation errors. Although you get the exact 4 same errors, this time the machine name field is not visible in edit mode (although we still throw a validation error about it) and there is no red border around the layout name and path fields:
I believe that:
- we should not trigger the machine name field at all in this case and also hide the validation error about the machine name from the user (they will fill in the layout name field anyways).
- the validation of this field should only be triggered if the user has clicked the "edit" link in order to manually enter a machine name.
- the validation errors when the user hits the "+ Add visibility condition" link should be accompanied by red borders around the missing required fields.
- [UX] Allow the user to change their mind about manually entering a machine name... #1608

