Problem/Motivation

The validation error message when using the minimum length setting for an element is imprecise; it says the value "must be longer than", instead of "must be at least".

Example screenshot (please excuse the overly long element name!) :

Screenshot demonstrating the imprecise error message

Configuring a maximum length isn't necessary, but this issue will especially confuse users who have to enter values within both constraints. (e.g. a user enters too many characters and is told one thing, then too few and is then told a potentially-conflicting message).

Steps to reproduce

Configure a webform element using a minimum length. Attempt submitting a value in this element with a value that is shorter than this. The message says the value needs to be longer than the configured length, but a value matching the configured length should be acceptable.

Example configuration screenshot:

Screenshot showing a minimum character length configuration

Proposed resolution

Adjust the validation message.

Remaining tasks

Provide & review patch

User interface changes

Translatable string change

API changes

None

Data model changes

None

Issue fork webform-3413151

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

james.williams created an issue. See original summary.

sourabhjain’s picture

Assigned: Unassigned » sourabhjain

Let me work on this.

sourabhjain’s picture

Assigned: sourabhjain » Unassigned
Status: Active » Needs review
james.williams’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, thank you! I see the phpunit tests are passing; the validation job fails look to be the same as in HEAD.

james.williams’s picture

Status: Reviewed & tested by the community » Needs review

My client wanted to make the validation message even clearer, when the max & min are actually the same. So I've adjusted this a little bit more.

jrockowitz made their first commit to this issue’s fork.

jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.