Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Pass the right validator options #2293

Merged
merged 1 commit into from Sep 4, 2012

Conversation

Projects
None yet
3 participants
@ghost

ghost commented Sep 4, 2012

This does not give the required result. It gives the isset result which is a boolean true or false.
(isset($this->attributes['min'])) ?: 0

I used a var_dump($options) in Zend\validator\GreatherThan.php

var_dump with min value 0:
array (size=2)
'min' => boolean true
'inclusive' => boolean true

var_dump with min value 5:
array (size=2)
'min' => boolean true
'inclusive' => boolean true

This does work. It adds the value as expected.
(isset($this->attributes['min'])) ? $this->attributes['min'] : 0, 

var_dump with min value 0:
array (size=2)
'min' => int 0
'inclusive' => boolean true

var_dump with min value 5:
array (size=2)
'min' => int 5
'inclusive' => boolean true

Update library/Zend/Form/Element/Range.php
This does not give the required result. It gives the isset result which is a boolean true or false.
(isset($this->attributes['min'])) ?: 0

This does work. It adds the value as expected.
(isset($this->attributes['min'])) ? $this->attributes['min'] : 0, 

This pull request passes (merged 9a4571f into 3a4cee6).

weierophinney added a commit that referenced this pull request Sep 4, 2012

[#2293] Reverted files to release branch
- README.md, ParameterReflection, and Version needed to be reverted to release
  branch in order to merge cleanly.

@weierophinney weierophinney merged commit 9a4571f into zendframework:master Sep 4, 2012

1 check passed

default The Travis build passed
Details
Owner

weierophinney commented Sep 4, 2012

Merged to 2.0.0, 2.0.1, and master.

fabiocarneiro pushed a commit to fabiocarneiro/zend-form that referenced this pull request Feb 4, 2015

Pass the right validator options
Same issue as with zendframework/zendframework#2293

It passes the value of isset and not the min/step attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment