Problem/Motivation

When inline_form_errors is enabled, there is a summary that is displayed at the top of the page in a status message, when the form has field errors.

It is supposed to contain anchor links to the relevant fields, for the user to click on and correct the error.

example

However, on the text_textarea and text_textfield widgets, the anchor link is broken. It links to #edit-foobar-0, which is an ID that doesn't exist on the page, instead of #edit-foobar-0-value, which is the actual form field element.

The root cause is that the errorElement function on those widgets doesn't point to the proper form value element.

Steps to reproduce

1. Ensure that inline_form_errors is enabled.
2. Create a text or text_long field to a node bundle.
3. Add a constraint to the field definition on the bundle.
4. Create and save a node with a value that triggers a constraint validation error on the field.
5. Note that the link in the error summary status message does not work.

Proposed resolution

Update the errorElement function to point to value.

CommentFileSizeAuthor
example.png10.02 KBodensc

Issue fork drupal-3635418

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

odensc created an issue. See original summary.

odensc’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Can we move the inline_form_errors test to it's own file. Not sure that needs to be installed for all tests