BUGFIX: fix regression with literal fields not showing content

This commit is contained in:
Will Rossiter 2012-05-07 18:10:57 +12:00
parent aa67b9da2f
commit 6c1b843fac

View File

@ -348,7 +348,7 @@ class UserDefinedForm_Controller extends Page_Controller {
// generate the conditional logic // generate the conditional logic
$this->generateConditionalJavascript(); $this->generateConditionalJavascript();
$form = new Form($this, "Form", $fields, $actions, $required); $form = new Form($this, "Form", $fields, $actions, $required);
$data = Session::get("FormInfo.{$form->FormName()}.data"); $data = Session::get("FormInfo.{$form->FormName()}.data");
@ -369,7 +369,7 @@ class UserDefinedForm_Controller extends Page_Controller {
*/ */
function getFormFields() { function getFormFields() {
$fields = new FieldSet(); $fields = new FieldSet();
if($this->Fields()) { if($this->Fields()) {
foreach($this->Fields() as $editableField) { foreach($this->Fields() as $editableField) {
// get the raw form field from the editable version // get the raw form field from the editable version
@ -394,7 +394,6 @@ class UserDefinedForm_Controller extends Page_Controller {
$field->setTitle($title); $field->setTitle($title);
} }
} }
// if this field has an extra class // if this field has an extra class
if($editableField->getSetting('ExtraClass')) { if($editableField->getSetting('ExtraClass')) {
$field->addExtraClass(Convert::raw2att( $field->addExtraClass(Convert::raw2att(
@ -404,15 +403,15 @@ class UserDefinedForm_Controller extends Page_Controller {
// set the values passed by the url to the field // set the values passed by the url to the field
$request = $this->getRequest(); $request = $this->getRequest();
$value = Convert::raw2att($request->getVar($field->name)); if($var = $request->getVar($field->name)) {
if(isset($value)) $field->value = $value; $field->value = Convert::raw2att($var);
}
$fields->push($field); $fields->push($field);
} }
} }
$this->extend('updateFormFields', $fields); $this->extend('updateFormFields', $fields);
return $fields; return $fields;
} }