Development

#4262 (mergeform doesn't merge labels but does merge default values)

You must first sign up to be able to contribute.

Ticket #4262 (closed enhancement: fixed)

Opened 10 months ago

Last modified 10 months ago

mergeform doesn't merge labels but does merge default values

Reported by: weett Assigned to: fabien
Priority: minor Milestone: 1.1.2
Component: form Version: 1.1.0
Keywords: mergeForm Cc:
Qualification: Unreviewed

Description

In the API is noted that only widgets and validators are merged:

sfForm::mergeForm ($form)
$form 	The sfForm instance to merge with current form

Merges current form widget and validator schemas with the ones from the sfForm object passed as parameter

throws LogicException If one of the form has already been bound

In the code it appears that defaults are also merged, which is not stated in the documentation. What I expected was that mergeForm would also merge the labels.

Solution is to add this line to sfForm::mergeForm :

  $this->getWidgetSchema()->setLabels(array_merge($this->getWidgetSchema()->getLabels(),$form->getWidgetSchema()->getLabels()));

Change History

09/04/08 22:27:40 changed by fabien

  • version changed from 1.0.17 to 1.1.0.
  • milestone set to 1.1.2.

09/17/08 20:46:34 changed by nicolas

  • status changed from new to closed.
  • resolution set to fixed.

(In [11621]) [1.1] fixed sfForm::mergeForm() doesn't merge widget schema labels (fixes #4262)

09/17/08 20:47:31 changed by nicolas

(In [11622]) [1.2] forthport of r11621: fixed sfForm::mergeForm() doesn't merge widget schema labels (refs #4262)

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.