Zend Framework

Improved error message for isEmpty

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.7.2
  • Component/s: Zend_Validate
  • Labels:
    None

Description

REGARDING
Zend_Validate_NotEmpty

PROBLEM
The current error message is written in a complicated way. I know it's not a priority for the ZF team to make minor adjustments to error messages there are specific reasons:
1. Since this particular validator is often added by default, at validation time, there is no easy way to modify the error message using setMessage without adding the validator to all relevant elements.
2. Furthermore it's probably the most common error message, and could deserve some extra attention because of that.

Thus the reason for a global, improved error message.

Current error message:
self::IS_EMPTY => "Value is empty, but a non-empty value is required"

Suggested error message1:
self::IS_EMPTY => "Required and can't be empty."

Suggested error message2:
self::IS_EMPTY => "[LABEL_VALUE_HERE] is required and can't be empty."

Activity

Hide
Kristof Vansant added a comment -

You must fill this in. Is maybe even more non technical :d

Show
Kristof Vansant added a comment - You must fill this in. Is maybe even more non technical :d
Hide
Thomas Weidner added a comment -

The second is not possible...
The label value is not given to the validator so the validator can not add the label to it's error message.
And the value itself would bring nothing as it's empty.

Show
Thomas Weidner added a comment - The second is not possible... The label value is not given to the validator so the validator can not add the label to it's error message. And the value itself would bring nothing as it's empty.
Hide
Thomas Weidner added a comment -

Changed with r13226

Show
Thomas Weidner added a comment - Changed with r13226

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: