#1290: Validated Arguments are discarded in case a validator wrapped by an
AgaviOroperatorValidator fails on them
-----------------------------------------+----------------------------------
Reporter: sven.kretschm...@… | Owner: dominik
Type: defect | Status: new
Priority: normal | Milestone: 1.0.4
Component: validation | Version: 1.0.3
Severity: normal | Keywords:
Has_patch: 0 |
-----------------------------------------+----------------------------------
Comment(by sven.kretschm...@…):
After some lookup with a colleague we found the reason in the severity. I
was not aware of the silent severity removing failed arguments as well.
We removed the or- wrapper and now only use the inarray validator to
validate the value and following equals validators with an info severity
for the dependencies:
{{{
#!xml
<validator class="inarray" provides="valid_payment_type">
<arguments>
<argument>payment_type</argument>
</arguments>
<ae:parameters>
<ae:parameter name="values">bank,cc</ae:parameter>
</ae:parameters>
<errors>
<error>No valid payment type selected.</error>
</errors>
</validator>
<validator class="equals" depends="valid_payment_type"
provides="payment_bank">
<arguments>
<argument>payment_type</argument>
</arguments>
<ae:parameters>
<ae:parameter name="value">bank</ae:parameter>
<ae:parameter name="severity">info</ae:parameter>
</ae:parameters>
</validator>
<validator class="equals" depends="valid_payment_type"
provides="payment_cc">
<arguments>
<argument>payment_type</argument>
</arguments>
<ae:parameters>
<ae:parameter name="value">cc</ae:parameter>
<ae:parameter name="severity">info</ae:parameter>
</ae:parameters>
</validator>
}}}
This works very well, in addition to the markup being more readable than
before.
Greets, Sven
--
Ticket URL: <http://trac.agavi.org/ticket/1290#comment:1>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5
_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets