BUGFIX Fixed a critical error saving a UserDefinedForm page type

This commit is contained in:
Sean Harvey 2008-09-29 05:42:46 +00:00
parent 74d69a30fe
commit fb633252d0

View File

@ -86,13 +86,15 @@ class EditableFormField extends DataObject {
function populateFromPostData( $data ) { function populateFromPostData( $data ) {
$this->Title = $data['Title']; $this->Title = $data['Title'];
if(isset($data['Default'])) { if(isset($data['Default'])) {
$this->setField('Default', $data['Default']); $this->setField('Default', $data['Default']);
} }
$this->Sort = isset($data['Sort']) ? $data['Sort'] : null; $this->Sort = isset($data['Sort']) ? $data['Sort'] : null;
$this->CustomParameter = $data['CustomParameter']; $this->CustomParameter = isset($data['CustomParameter']) ? $data['CustomParameter'] : null;
$this->Required = !empty( $data['Required'] ) ? 1 : 0; $this->Required = !empty($data['Required']) ? 1 : 0;
$this->CanDelete = ( isset( $data['CanDelete'] ) && !$data['CanDelete'] ) ? 0 : 1; $this->CanDelete = (isset($data['CanDelete']) && !$data['CanDelete']) ? 0 : 1;
$this->write(); $this->write();
// The field must be written to ensure a unique ID. // The field must be written to ensure a unique ID.