|
Scheduling for final release I haven't gotten to multiselect yet, sry Your fix NotEmpty validator does not handle empty array: May be better just add 2 exceptions for ( http://php.net/empty Re-scheduling for 1.5.1. 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. 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. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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