ZF-10516: Empty Zend_Dojo_Form_Element_Editor returns <br _moz_editor_bogus_node="TRUE" />
Description
When submitting empty form.
The value of the field created by Zend_Dojo_Form_Element_Editor instead of being empty contains the value:
I found a solution here: http://journaldeguillaume.blogspot.com/2010/02/… It's as simple as adding filter to editor:
->setFilters(array('StringTrim',
array('PregReplace',array('#
#i',''))
))
But I guess this bug should be solved anyway. Regards, Greg
Firefox 3.6.10
it's similar to the bug: http://zendframework.com/issues/browse/ZF-8707 but i'm not sure if these are the same things as the author seems to focus on another thing.
Comments
Posted by Robert Basic (robertbasic) on 2011-04-22T21:41:32.000+0000
I've been looking into this for a while now, looks like Firefox adds that BR tag on it's own. Googling/IRCing didn't help. Same issue also appears/appeared in editors like CKEditor and FCKEditor.
The following code snippet/patch shows how we could fix this, but this looks hacky/dirty. Also it breaks one test ({{testHelperShouldCreateJavascriptToConnectEditorToHiddenValue}}); that test tests for the line which is edited/deleted in the patch bellow.
Posted by Matthew Weier O'Phinney (matthew) on 2011-05-02T17:18:12.000+0000
Patch actually looks reasonable; the functionality that exists is largely due to inconsistencies in how browsers handle textarea submissions coming from non-textarea input.
I've applied the patch to trunk and the 1.11 release branch, along with test modifications.
Posted by Robert Basic (robertbasic) on 2011-08-01T12:43:50.000+0000
Pull request for porting the patch in ZF2 is sent: https://github.com/zendframework/zf2/pull/306