Ticket #1244 (closed defect: fixed)
range validator
| Reported by: | wolfheart | Owned by: | romanb |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Attributes | Version: | 1.0.0 |
| Severity: | Keywords: | range, null | |
| Cc: | Has Test: | no | |
| Status: | Pending Core Response | Has Patch: | no |
Description
example: $this->hasColumn('this_id', 'integer', 4, array('range' => array(5, 10)));
$recordthis_id? = NULL; NULL is valid as we implicitely set notnull = false, but the range validator prevents this by reading NULL as 0. The behaviour should be: if a value is set, it must lie between 5 and 10. If so: two additional lines in Validator/Range.php should do:
public function validate($value) {
if(is_null($value))
return true;
...
Change History
Note: See
TracTickets for help on using
tickets.