I've run into a problem with Zend_FIlter_Input and the ZF1.9 release. I have
various controller actions that start by doing something like this:
$input = new Zend_Filter_Input(array('lesson' => 'digits'), array('lesson'
=> 'int'), $this->getRequest()->getUserParams());
and then go on to use retrieved params like this: $input->lesson
This code has worked fine on various versions of the Framework up until 1.9.
Now, on 1.9 running on Production (PHP 5.2.1) $input->lesson is NULL.
If I dump out $input, the debug output is identical under 1.8 and 1.9. (see
below for output). And in either case I can see the correct value for
lesson. But when I retrieve it, as above, I get NULL.
Even more curiously, the code continues to work fine with 1.9 on my
development machine (OS X 10.4.11, PHP 5.2.4).
Obviously it is a show stopper for me as none of my controller actions can
retrieve URL params any more! I'm a newbie, so this kind of system specific
problem has me scratching my head.
Nick
DUMP OUTPUT
object(Zend_Filter_Input)#58 (12) {
["_data:protected"] => array(4) {
["controller"] => string(6) "lesson"
["action"] => string(6) "browse"
["lesson"] => string(2) "44"
["module"] => string(7) "default"
}
["_filterRules:protected"] => array(1) {
["lesson"] => string(6) "digits"
}
["_validatorRules:protected"] => array(1) {
["lesson"] => string(3) "int"
}
["_validFields:protected"] => array(0) {
}
["_invalidMessages:protected"] => array(0) {
}
["_invalidErrors:protected"] => array(0) {
}
["_missingFields:protected"] => array(0) {
}
["_unknownFields:protected"] => array(0) {
}
["_defaultEscapeFilter:protected"] => NULL
["_loaders:protected"] => array(0) {
}
["_defaults:protected"] => array(6) {
["allowEmpty"] => bool(false)
["breakChainOnFailure"] => bool(false)
["escapeFilter"] => string(12) "HtmlEntities"
["missingMessage"] => string(70) "Field '%field%' is required by rule
'%rule%', but the field is missing"
["notEmptyMessage"] => string(51) "You must give a non-empty value for
field '%field%'"
["presence"] => string(8) "optional"
}
["_processed:protected"] => bool(false)
}
--
View this message in context:
http://www.nabble.com/Zend_Filter_Input-problem-in-Zend-Framework-1.9-tp24853238p24853238.html
Sent from the Zend Framework mailing list archive at Nabble.com.