Zend Framework

getValues() truncates value if textarea element as the same name as its parent subform

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.5.2
  • Fix Version/s: 1.11.0
  • Component/s: Zend_Form
  • Labels:
    None
  • Fix Version Priority:
    Nice to Have

Description

if the textarea element has the same name as its parent subform.
$form->getValues() returns a truncated value, remaining just one
character in the foo element.

$foo = new Zend_Form_SubForm('foo') ;
$foo->addElement('textarea','foo') ;
$form->addSubform($foo,'foo') ;

Issue Links

Activity

Hide
Matthew Weier O'Phinney added a comment -

While this is a bug, the simple solution is to rename your subform; this will allow validation and rendering to work correctly, and keep the element name in line with your model.

Scheduling fix for next minor release, but as a low priority issue.

Show
Matthew Weier O'Phinney added a comment - While this is a bug, the simple solution is to rename your subform; this will allow validation and rendering to work correctly, and keep the element name in line with your model. Scheduling fix for next minor release, but as a low priority issue.
Hide
Michal Vrchota added a comment -

This problem is regarding to all form elements, not just textarea. All elements inside subform MUST have DIFFERENT name. It is sometimes confusing and it is easy to pass over it

Show
Michal Vrchota added a comment - This problem is regarding to all form elements, not just textarea. All elements inside subform MUST have DIFFERENT name. It is sometimes confusing and it is easy to pass over it
Hide
Christian Beier added a comment -

Indeed it is. Especially if you use radio elements in the subform "foo". If you select the "foo" radio every other is auto selected. Was building an ACL interface and map resource to subform for the radio buttons of linked privileges. Nice surprise, but at least I recognised it before deployment. Hopefully I find time to diggin the code and provide a patch.

Show
Christian Beier added a comment - Indeed it is. Especially if you use radio elements in the subform "foo". If you select the "foo" radio every other is auto selected. Was building an ACL interface and map resource to subform for the radio buttons of linked privileges. Nice surprise, but at least I recognised it before deployment. Hopefully I find time to diggin the code and provide a patch.
Hide
Christian Albrecht added a comment -

Fixed in ZF-9348

Show
Christian Albrecht added a comment - Fixed in ZF-9348
Hide
Christian Albrecht added a comment -

Reopened because suggested fix is not reviewed and committed yet.

Show
Christian Albrecht added a comment - Reopened because suggested fix is not reviewed and committed yet.
Hide
Christian Albrecht added a comment -

Matthew Weier O'Phinney resolved ZF-9348 Patch applied to trunk and 1.10 release branch.

Show
Christian Albrecht added a comment - Matthew Weier O'Phinney resolved ZF-9348 Patch applied to trunk and 1.10 release branch.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: