#582: Named validators clash
------------------------+---------------------------------------------------
Reporter: MikeSeth | Owner: dominik
Type: defect | Status: new
Priority: normal | Milestone:
Component: validation | Version: 0.11.0RC5
Severity: major | Keywords: validation conflict clash read write
------------------------+---------------------------------------------------
It is impossible to have validators with the same name in both read and
write contexts of an action. The validators are read linearly, and write
validators override read validators with the same name. However, write
validators only respond to write methods and so would not be executed by
the validation manager in a read action. In other words, a read validator
with the same name as a write validator would not work.
For example, in this configuration the read validation would be queried
because validator names are different :
<validators method="read">
<validator class="isnotempty" name="username_present"
severity="error" required="true">
<argument>username</argument>
</validator>
</validators>
<validators method="write">
<validator class="isnotempty" name="no_username" severity="error"
required="true">
<argument>username</argument>
</validator>
</validators>
However, in this configuration the names are the same and so the read
validator would not be executed in read context:
<validators method="read">
<validator class="isnotempty" name="no_username" severity="error"
required="true">
<argument>username</argument>
</validator>
</validators>
<validators method="write">
<validator class="isnotempty" name="no_username" severity="error"
required="true">
<argument>username</argument>
</validator>
</validators>
--
Ticket URL: <http://trac.agavi.org/ticket/582>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5
_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets