Ticket #833 (closed defect: fixed)
AgaviEqualsValidator's docs do not match the actual validation process
| Reported by: | morkai@… | Owned by: | dominik |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11.3 |
| Component: | validation | Version: | 1.0.0beta1 |
| Severity: | normal | Keywords: | validation AgaviEqualsValidator asparam |
| Cc: | Patch attached: | yes |
Description (last modified by david) (diff)
The doc comment of AgaviEqualsValidator states:
* When the parameter 'asparam' is true, the content in 'value' is taken as a * parameter name and the check is performed against it's value otherwise the * content in 'value' is taken.
but the process() method doesn't use the asparam at all.
To make it work currently, one has to write:
<validator class="equals">
<arguments>
<argument>password2</argument>
<argument>password</argument>
</arguments>
<error>Passwords do not match</error>
</validator>
but when validation fails, error message is added to both fields.
With attached patch, one can write:
<validator class="equals">
<argument>password2</argument>
<parameters>
<parameter name="value">password</parameter>
<parameter name="asparam">true</parameter>
</parameters>
<error>Passwords do not match</error>
</validator>
and error message will be added only to the field(s) specified as argument(s).
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

