|
|
|
[
Permlink
| « Hide
]
Vladimir Michailenko - 11/Mar/08 12:59 PM
Also option in Zend_Form_Element_Multiselect with key "0" can not be marked as 'selected' via ->populate() or ->setValue(). For example: http://www.nabble.com/Zend_Form_Element_Multiselect-and-option-with-key-'0'-td15853694s16154.html
I haven't gotten to multiselect yet, sry
maybe in a few days or matthew will fix it Your fix NotEmpty validator does not handle empty array:
$value = array(); May be better just add 2 exceptions for ( http://php.net/empty Resetting 'fix version priority' and 'fix version' to be re-evaluated for next release.
Ran into the same issue here. No one on #zftalk knew anything about it either.
I'm verry sorry, but someone else will have to fix this as I don't have the time right now.
One note: empty() doesn't make sense, since all we need is to check for "" and array(), this are 2 "operations" instead of 7 with empty() Scheduling for next mini release.
Resolved in trunk and 1.5 release branch
Version from trunk:
$this->addElement('select', 'parent_id', array( When I choose "Root" category I still get error... Zend_Validate_NotEmpty: if (empty($value)) { $this->_error(); return false; } php.net/empty: The following things are considered to be empty: Confirmed still an issue in 1.5.2 release.
Zend_Debug::dump(Zend_Validate::is('0', 'NotEmpty')); // false This is still an issue in 1.6.0rc1, I would reopen this issue but lack the ability.
<?php
require_once 'Zend/Version.php';
require_once 'Zend/Validate.php';
var_dump(Zend_Version::VERSION);
var_dump(Zend_Validate::is('1', 'NotEmpty'));
var_dump(Zend_Validate::is('0', 'NotEmpty'));
/*
Expected output:
string(3) "1.6"
bool(true)
bool(true)
Actual output:
string(3) "1.6"
bool(true)
bool(false)
*/
The modification was in Zend_Form. Zend_Validate still retains the old behavior, as this is correct in terms of how empty() works.
Please open a separate issue if you feel Zend_Validate_NotEmpty should be changed; be prepared to make a very good case for changing it. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||