Zend Framework

setElementDecorators() changes display of Image Element to Text Element

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 1.5.0RC1
  • Fix Version/s: 1.5.0
  • Component/s: Zend_Form
  • Labels:
    None
  • Fix Version Priority:
    Should Have

Description

When using decorators a Image Element is rendered as a Text Element

$image = new Zend_Form_Element_Image('submitImage');
$image->setLabel('')
	->setValue('test.gif')
	->setAttrib('class', 'button');
$form->addElement($image);
		
$form->setElementDecorators(array(
	array('ViewHelper'),
	array('Errors'),
	array('HtmlTag', array('tag' => 'dd')),
	array('Label', array('tag' => 'dt')),
));

<input type="text" name="submitImage" id="submitImage" value="test.gif" class="button">

A quick look at the image attributes shows the helper is defined as fromText
var_dump($image->getAttribs());

Outputs:
array(2) { ["helper"]=> string(8) "formText" ["class"]=> string(6) "button" }

Activity

Hide
Matthew Weier O'Phinney added a comment -

Need to add a $helper property to Image element to correct the issue.

Show
Matthew Weier O'Phinney added a comment - Need to add a $helper property to Image element to correct the issue.
Hide
Matthew Weier O'Phinney added a comment -

$helper property set to 'formImage' in trunk and release branch.

Show
Matthew Weier O'Phinney added a comment - $helper property set to 'formImage' in trunk and release branch.

People

Vote (0)
Watch (0)

Dates

  • Due:
    Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
15m
Original Estimate - 15 minutes
Remaining:
15m
Remaining Estimate - 15 minutes
Logged:
Not Specified
Time Spent - Not Specified