Problem/Motivation

Duplicate error messages are added to all fields in the fieldset when submitting a node edit form with an end date before the start.

This also shows the hidden duration field with error messages.

Steps to reproduce

  • Create the smart date field.
  • In the field settings set the allowed duration values to 'custom' and default duration to 0.
  • Fill out a node edit form and all mandatory fields.
  • Add an end date that is before the start date.
  • Save the node edit form.
  • User is presented with error messages on each of the fields in the smart date fieldset.

Proposed resolution

Only show the error message on the end date field as it is where the error originates and it makes it clearer to the author.

Issue fork smart_date-3477741

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

williamsona created an issue. See original summary.

williamsona’s picture

Issue summary: View changes
StatusFileSize
new94.36 KB

Screenshot to show the error message restricted to the end value after the code change.

williamsona’s picture

StatusFileSize
new1.1 KB
williamsona’s picture

StatusFileSize
new1.13 KB
williamsona’s picture

williamsona’s picture

StatusFileSize
new819 bytes
mortona2k’s picture

Related, and possibly duplicate issue.

mandclu’s picture

Status: Active » Closed (duplicate)

Confirmed that this was fixed as part of the work done in #3385720: Implement errorElement() in Widgets. Thanks for the work here.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.