Ticket #1244 (closed defect: fixed)

Opened 12 months ago

Last modified 10 months ago

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

Changed 11 months ago by romanb

  • owner changed from jwage to romanb

Changed 11 months ago by romanb

  • status changed from new to assigned

Changed 11 months ago by jwage

  • version changed from 0.11 to 1.0
  • milestone changed from Unknown to 1.0.0-RC1

Changed 11 months ago by jwage

Added coverage in r4749

Changed 11 months ago by jwage

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

(In [4750]) fixes #1244

Changed 10 months ago by anonymous

  • milestone New deleted

Milestone New deleted

Note: See TracTickets for help on using tickets.