From fb633252d0a98b89d659383ba1e389a06b767d97 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 29 Sep 2008 05:42:46 +0000 Subject: [PATCH] BUGFIX Fixed a critical error saving a UserDefinedForm page type --- code/editor/EditableFormField.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/editor/EditableFormField.php b/code/editor/EditableFormField.php index b23b682..ec72cbb 100755 --- a/code/editor/EditableFormField.php +++ b/code/editor/EditableFormField.php @@ -86,13 +86,15 @@ class EditableFormField extends DataObject { function populateFromPostData( $data ) { $this->Title = $data['Title']; + if(isset($data['Default'])) { $this->setField('Default', $data['Default']); } + $this->Sort = isset($data['Sort']) ? $data['Sort'] : null; - $this->CustomParameter = $data['CustomParameter']; - $this->Required = !empty( $data['Required'] ) ? 1 : 0; - $this->CanDelete = ( isset( $data['CanDelete'] ) && !$data['CanDelete'] ) ? 0 : 1; + $this->CustomParameter = isset($data['CustomParameter']) ? $data['CustomParameter'] : null; + $this->Required = !empty($data['Required']) ? 1 : 0; + $this->CanDelete = (isset($data['CanDelete']) && !$data['CanDelete']) ? 0 : 1; $this->write(); // The field must be written to ensure a unique ID.