Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291508

Wrong validation messages in Datelist::validateDatelist()

$
0
0

Problem/Motivation

If a datetime field is invalid, the error message is too generic. It is unclear what field is incorrect, especially if there are multiple datetime fields on the entity (color alone is not sufficient).

This is a bug because

  • Incorrect or misleading user interface text

and would qualify for an 8.1.x minor release.

Proposed resolution

Update error message for invalid datetime fields to include the field label.

Remaining tasks

Add test coverage for date-only fields.

User interface changes

Better error messages for invalid datetime fields.

API changes

None.

Data model changes

None.

Original Report

The validation handler for datelist \Drupal\Core\Datetime\Element\Datelist::validateDatelist form element has wrong error messages.

$form_state->setError($element, t('The %field date is required.'));

and

$form_state->setError($element, t('The %field date is invalid.'));


Viewing all articles
Browse latest Browse all 291508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>