-- umpirsky <umpir...@gmail.com> wrote (on Tuesday, 23 June 2009, 08:17 AM -0700): > thats ok, but since I'm not using Cache nor Translate, this shouldn't > happen.
Again, the Int validator is using Zend_Locale, which is using Zend_Translate, which is using Zend_Cache -- and apparently Zend_Translate is instantiating a cache with some faulty defaults if none is registered. I've got a question in to the i18n maintainer to find out why this is necessary and to get a solution in place. Also, as asked previously, what version of ZF are you using? or are you using directly from trunk? > umpirsky wrote: > > > > Anyone? > > > > Why this validator use cache at all? > > > > Regards, > > Sasa Stamenkovic. > > > > > > umpirsky wrote: > >> > >> It works without int validator, you point at Zend_Locale which I don't > >> use on this site, right? > >> So, what would be the fix if I want to keep this validator? > >> > >> Regards, > >> Sasa Stamenkovic. > >> > >> > >> Matthew Weier O'Phinney-3 wrote: > >>> > >>> -- umpirsky <umpir...@gmail.com> wrote > >>> (on Monday, 22 June 2009, 08:36 AM -0700): > >>>> This is my form: > >>> > >>> What happens if you remove the "Int" validator from that element? If it > >>> works, I think I know what the issue might be. > >>> > >>> > >>>> class Umpirsky_Form_Encryption extends Zend_Form { > >>>> /** > >>>> * Initialize form, add elements. > >>>> */ > >>>> public function initialize($suffix, $textName, $textValue, > >>>> $encryptionSize, > >>>> $hiddenName, $hiddenValue, $submitName, $delete) { > >>>> $this->setDecorators(array( > >>>> 'FormElements', > >>>> array('HtmlTag', array('tag' => 'fieldset')), > >>>> 'Form' > >>>> )); > >>>> $text = new Zend_Form_Element_Text(array('id' => $textName . > >>>> $suffix, > >>>> 'name' => $textName, 'value' => $textValue, 'class' => 'text')); > >>>> $text->setLabel('Name:'); > >>>> $text->setDecorators(array( > >>>> 'ViewHelper', > >>>> array(array('descBreak' => 'HtmlTag'), array('tag' => > >>>> 'br', > >>>> 'placement' > >>>> => Zend_Form_Decorator_Abstract::PREPEND)), > >>>> 'Label', > >>>> array('HtmlTag', array('tag' => 'p')) > >>>> )); > >>>> $text->setRequired(true); > >>>> $text->addValidator(new Zend_Validate_StringLength(1, 32)); > >>>> $this->addElement($text); > >>>> $text2 = new Zend_Form_Element_Text(array('id' => > >>>> 'EncryptionSize' . > >>>> $suffix, 'name' => 'EncryptionSize', 'value' => $encryptionSize, > >>>> 'class' => > >>>> 'text')); > >>>> $text2->setLabel('Size:'); > >>>> $text2->setDecorators(array( > >>>> 'ViewHelper', > >>>> array(array('descBreak' => 'HtmlTag'), array('tag' => > >>>> 'br', > >>>> 'placement' > >>>> => Zend_Form_Decorator_Abstract::PREPEND)), > >>>> 'Label', > >>>> array('HtmlTag', array('tag' => 'p')) > >>>> )); > >>>> $text2->addValidator(new Zend_Validate_Int()); > >>>> $this->addElement($text2); > >>>> $hidden = new Zend_Form_Element_Hidden(array('id' => > >>>> $hiddenName . > >>>> $suffix,'name' => $hiddenName, 'value' => $hiddenValue)); > >>>> $hidden->setDecorators(array( > >>>> 'ViewHelper' > >>>> )); > >>>> $this->addElement($hidden); > >>>> $submit = new Zend_Form_Element_Submit(array('id' => > >>>> 'submit' . > >>>> $suffix, > >>>> 'name' => $submitName)); > >>>> $submit->setDecorators(array( > >>>> 'ViewHelper', > >>>> 'Description' > >>>> )); > >>>> $this->addElement($submit); > >>>> if ($delete) { > >>>> $delete = new Zend_Form_Element_Submit(array('id' => > >>>> 'delete' . > >>>> $suffix, > >>>> 'name' => 'Delete')); > >>>> $delete->setDecorators(array( > >>>> 'ViewHelper', > >>>> 'Description' > >>>> )); > >>>> $this->addElement($delete); > >>>> } > >>>> } > >>>> } > >>>> > >>>> When I remove text2, it works ok, like this > >>>> > >>>> class Umpirsky_Form_Encryption extends Zend_Form { > >>>> /** > >>>> * Initialize form, add elements. > >>>> */ > >>>> public function initialize($suffix, $textName, $textValue, > >>>> $encryptionSize, > >>>> $hiddenName, $hiddenValue, $submitName, $delete) { > >>>> $this->setDecorators(array( > >>>> 'FormElements', > >>>> array('HtmlTag', array('tag' => 'fieldset')), > >>>> 'Form' > >>>> )); > >>>> $text = new Zend_Form_Element_Text(array('id' => $textName . > >>>> $suffix, > >>>> 'name' => $textName, 'value' => $textValue, 'class' => 'text')); > >>>> $text->setLabel('Name:'); > >>>> $text->setDecorators(array( > >>>> 'ViewHelper', > >>>> array(array('descBreak' => 'HtmlTag'), array('tag' => > >>>> 'br', > >>>> 'placement' > >>>> => Zend_Form_Decorator_Abstract::PREPEND)), > >>>> 'Label', > >>>> array('HtmlTag', array('tag' => 'p')) > >>>> )); > >>>> $text->setRequired(true); > >>>> $text->addValidator(new Zend_Validate_StringLength(1, 32)); > >>>> $this->addElement($text); > >>>> $text2 = new Zend_Form_Element_Text(array('id' => > >>>> 'EncryptionSize' . > >>>> $suffix, 'name' => 'EncryptionSize', 'value' => $encryptionSize, > >>>> 'class' => > >>>> 'text')); > >>>> $text2->setLabel('Size:'); > >>>> $text2->setDecorators(array( > >>>> 'ViewHelper', > >>>> array(array('descBreak' => 'HtmlTag'), array('tag' => > >>>> 'br', > >>>> 'placement' > >>>> => Zend_Form_Decorator_Abstract::PREPEND)), > >>>> 'Label', > >>>> array('HtmlTag', array('tag' => 'p')) > >>>> )); > >>>> $text2->addValidator(new Zend_Validate_Int()); > >>>> //$this->addElement($text2); > >>>> $hidden = new Zend_Form_Element_Hidden(array('id' => > >>>> $hiddenName . > >>>> $suffix,'name' => $hiddenName, 'value' => $hiddenValue)); > >>>> $hidden->setDecorators(array( > >>>> 'ViewHelper' > >>>> )); > >>>> $this->addElement($hidden); > >>>> $submit = new Zend_Form_Element_Submit(array('id' => > >>>> 'submit' . > >>>> $suffix, > >>>> 'name' => $submitName)); > >>>> $submit->setDecorators(array( > >>>> 'ViewHelper', > >>>> 'Description' > >>>> )); > >>>> $this->addElement($submit); > >>>> if ($delete) { > >>>> $delete = new Zend_Form_Element_Submit(array('id' => > >>>> 'delete' . > >>>> $suffix, > >>>> 'name' => 'Delete')); > >>>> $delete->setDecorators(array( > >>>> 'ViewHelper', > >>>> 'Description' > >>>> )); > >>>> $this->addElement($delete); > >>>> } > >>>> } > >>>> } > >>>> > >>>> > >>>> Any idea? > >>>> > >>>> Regards, > >>>> Sasa Stamenkovic. > >>>> -- > >>>> View this message in context: > >>>> http://www.nabble.com/Strange-Zend_Form-cache-problem%2C-please-URGENT-tp24148767p24149251.html > >>>> Sent from the Zend Framework mailing list archive at Nabble.com. > >>>> > >>> > >>> -- > >>> Matthew Weier O'Phinney > >>> Project Lead | matt...@zend.com > >>> Zend Framework | http://framework.zend.com/ > >>> > >>> > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Strange-Zend_Form-cache-problem%2C-please-URGENT-tp24148767p24167317.html > Sent from the Zend Framework mailing list archive at Nabble.com. > -- Matthew Weier O'Phinney Project Lead | matt...@zend.com Zend Framework | http://framework.zend.com/