Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

importing the fix for ZF-11315 #303

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions library/Zend/Dojo/View/Helper/Editor.php
Expand Up @@ -112,8 +112,7 @@ public function direct($id = null, $value = null, $params = array(), $attribs =

$attribs = $this->_prepareDijit($attribs, $params, 'textarea');

$html = '<input' . $this->_htmlAttribs($hiddenAttribs) . $this->getClosingBracket();
$html .= '<div' . $this->_htmlAttribs($attribs) . '>'
$html = '<div' . $this->_htmlAttribs($attribs) . '>'
. $value
. "</div>\n";

Expand All @@ -123,6 +122,8 @@ public function direct($id = null, $value = null, $params = array(), $attribs =
. $this->view->broker('formTextarea')->direct($hiddenId, $value, $attribs)
. '</noscript>';

$html .= '<input' . $this->_htmlAttribs($hiddenAttribs) . $this->getClosingBracket();

return $html;
}

Expand Down
9 changes: 9 additions & 0 deletions tests/Zend/Dojo/View/Helper/EditorTest.php
Expand Up @@ -179,4 +179,13 @@ public function testHelperShouldOnlyUseTextareaInNoscriptTag()
$html = $this->helper->direct('foo');
$this->assertRegexp('#<noscript><textarea[^>]*>#', $html, $html);
}

/**
* @group ZF-11315
*/
public function testHiddenInputShouldBeRenderedLast()
{
$html = $this->helper->direct('foo');
$this->assertRegexp('#</noscript><input#', $html, $html);
}
}