ZF-2829: Populate nulls out Image src
Description
When I populate a form my image src attrib is being set to null
Code below:
$image = new Zend_Form_Element_Image('submitImage');
$image->setLabel('')
->setValue('test.gif')
->setAttrib('class', 'button');
$form->addElement($image);
Outputs:
if ($this->_request->isPost()) {
if ($form->isValid($this->_request->getPost())) {
} else {
$form->populate($this->_request->getPost());
}
}
Outputs:
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2008-03-07T14:45:09.000+0000
Scheduling for RC2
Posted by Matthew Weier O'Phinney (matthew) on 2008-03-07T16:28:39.000+0000
Fixed in trunk and release branch.
Images now behave pretty differently:
Posted by Ken Crane (kcrane377) on 2008-03-08T11:56:58.000+0000
First i wanted to offer you a very big thank you for all your help and work on the Image Element.
Secondly i would like to point out that the setImageValue() method is not setting the value attrib as expected. It is always being passed to the view helper as NULL and thus returning false for isChecked().
Example: Sets value attrib but isChecked is returned false
Value attrib is not set and isChecked is returned false
Ken
Posted by Matthew Weier O'Phinney (matthew) on 2008-03-17T13:39:36.000+0000
Ken, I cannot reproduce what you're saying. I have the following code:
Expected and actual results are:
Posted by Ken Crane (kcrane377) on 2008-03-17T14:54:47.000+0000
You are correct. Issue has been resolved. I forgot to attach revision # that i was using when this was happening. All is working as expected currently.
Thanks Ken