The main issue was about the user form and problematic error reporting. However, this problem was made bigger by defining it as:

If a field depends on another field which is faulty, the dependee field should be highlighted and show an error.

This is however something that should be handled on form validation and is outside of the scope of inline form errors.

The problematic case of the user profile form is handled in: #2455933: Error highlighting and reporting problems for the current password on the user profile form

Problem/Motivation

Follow up to #1493324: Inline form errors for accessibility and UX and #2455933: Error highlighting and reporting problems for the current password on the user profile form

With the new inline form errors, dependent fields should be linked to as they are in the global message. This will make navigattiong forms easier for screen reader users and keyboard only users.

A good example of this is the user edit form. The password change is dependent on the user entering their current password. If a user enters a new password but no current password, the error "Your current password is missing or incorrect; it's required to change the Password". Here, the "current password" should link to the actual change password field.

Proposed resolution

Remaining tasks

User interface changes

Example of end result. Change password is highlighted with an arrow pointing to the change password field

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

crasx’s picture

Issue summary: View changes
FileSize
91.42 KB
joyceg’s picture

Is the issue actually requiring a link or highlighting the current password field like the 'password' and 'confirm password' fields as shown in the image?

joyceg’s picture

The error message also needs to be modified. The use of apostrophe makes it look weird.

mgifford’s picture

The text "Your current password is missing or incorrect; it's required to change the Password" should be right under the "Current password" field (usually under the description actually).

This way the link from the "password" error at the top will go right to where it needs to be changed rather than 4 fields below where in is needed, when a user clicks on it.

AaronChristian’s picture

Issue summary: View changes
FileSize
42.94 KB
76.92 KB

It terms of visual grouping and best practices, the "Current Password" field should be right above the fields where you set your new password. At least this is how most websites handle changing password functionality.

SKAUGHT’s picture

project Password tab D7 makes core act this way. of course, It would be more ideal UX/UI pattern as /user/%/edit page is busy, to say. Otherwise wrapping these 3 fields in a fieldset would as least visual group them.

SKAUGHT’s picture

just realized, password entry is needed for changing email too. Again, it's a busy little page.

SKAUGHT’s picture

@mgifford
i've delt with this by altering the User Module itself by reworking how the validation process senses errors. I don't think anythings wrong with the IFE module, as such.. but the way the actual form is building errors.

other touchups this includes

  • wrapping change password with fieldset
  • moving description up to top of fieldset (now a paragraph on top) which also leaves the javascript response for matching more readable.
  • wrapping both the account status and Roles into a collapsible details
  • weighting the Username and Email to the top of all items.

my comment about the password tabs, was just a comment. certainly i'm not going to try to alter anything that much.

SKAUGHT’s picture

SKAUGHT’s picture

Status: Active » Needs review
FileSize
116.73 KB

had attached same image twice.

SKAUGHT’s picture

this resets one phase i shouldn't have touched.

SKAUGHT’s picture

Issue summary: View changes

removing summary 'Data model changes' images from comment 6

Status: Needs review » Needs work
SKAUGHT’s picture

SKAUGHT’s picture

Status: Needs work » Needs review
SKAUGHT’s picture

sorry #15 had typo. also corrects label uppercasing to match

SKAUGHT’s picture

Status: Needs review » Needs work

down-stepping status for now.

SKAUGHT’s picture

SKAUGHT’s picture

umm.
in relation to original issue 2455933 and mikes comment#8 . I've just realized they remade the ticket toward different subsystem. My patch should be against the org ticket.

from what i currently best understand:
This AccountFrom (in User module) isn't just a 'normal drupal form' (certainly its not a form plugin) -- it is ContentEntityForm and ties into a Validation Constraint. So my patch simply adds in a routine during it's flagValidation to rework the messages and adds in the Current Password field to be now marked as 'in error' and reworks messages..

To the point regarding FAPI, its true that fields do not have a property to notify that another child field should be triggered as an error during validation. And possibly then, a property to hold that special error message.

I would agree that it would be nice have FAPI have the ability, but this is as much a use case for forms that have more complex validation tie backs.

a follow up thought:

  • (in general) the interaction with #states
  • giving this originates from the /user forms. this error does have 2 fields that can act against it: the password field & email field both can trigger error on Current Password (formatPlural instances from parent errors)
SKAUGHT’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

yoroy’s picture

Issue tags: +ux-workflow
mgifford’s picture

Patch no longer applies to 8.1.

mgifford’s picture

SKAUGHT’s picture

@dmsmidt, should you get here..
please over this issue, look at #2455933: Error highlighting and reporting problems for the current password on the user profile form that patch is more current to this one. they are one in the same

mgifford’s picture

Status: Needs review » Closed (duplicate)
dmsmidt’s picture

Title: When adding dependent field error messages, message should contain link to dependent field » Inline form error reporting problems for the current password on the user profile form
Issue summary: View changes

Just cleaning up a bit.

apaderno’s picture

Issue tags: -accesssibility +accessibility
mgifford’s picture

Issue tags: -accessibility (duplicate tag) +Accessibility

Fixing the tag.