Lack of interest Improve error messages generated by \XF\Mvc\Entity\ValueFormatter::applyValueConstraints()

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

Kirby

Well-known member
If \XF\Mvc\Entity\ValueFormatter::applyValueConstraints() is called for a column that has certain constraints (like min/max value, etc.) and the given value does not match these constraints, the generated error like
Please enter a value using {count} characters or fewer.
is rather unspecific.

For example if you try to add a link forum with a URL thant is longer than 150 characters, you will get the error
Please enter a value using 150 characters or fewer.

So the admin does not know which field does cause the error - it could be the title (if that is long), the description or the URL.

It would be nice if the generated error could be precise, maybe by passing in the Entity as an optional parameter and build the phrase name based on the Entity shortname and fieldname (with a fallback to a default phrase if that does not exist)?
 
Upvote 1
This suggestion has been closed. Votes are no longer accepted.
Back
Top Bottom