Ticket #582 (closed defect: fixed)

Opened 3 years ago

Last modified 22 hours ago

Named validators clash

Reported by: MikeSeth Owned by: dominik
Priority: normal Milestone: 0.11
Component: validation Version: 0.11.0RC5
Severity: major Keywords: validation conflict clash read write
Cc: Patch attached:

Description

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>

Attachments

Change History

Changed 3 years ago by mikeseth

Dominik says this is principally unfixable. Validator name uniqueness is an operational constraint. The validator loading mechanism should detect duplicate validator names and raise hell.

Changed 3 years ago by dominik

  • status changed from new to assigned
  • milestone set to 0.11

Changed 3 years ago by dominik

  • status changed from assigned to closed
  • resolution set to fixed

(In [2124]) allow validators for different methods have the same name fixes #582

Changed 22 hours ago by V1P3RC0P

Add/Change #582 (Named validators clash)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.