diff --git a/core/model/DataObject.php b/core/model/DataObject.php index 254ac72a1..7dee39c76 100644 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -643,6 +643,7 @@ class DataObject extends Controller { public function getComponents($componentName, $filter = "", $sort = "", $join = "", $limit = "", $having = "") { // TODO Does not take different SQL-parameters into account on subsequent calls if(isset($this->componentCache[$componentName])) { + if(isset($this->componentCache[$componentName]) && false != $this->componentCache[$componentName]) { return $this->componentCache[$componentName]; } @@ -701,6 +702,7 @@ class DataObject extends Controller { foreach($allClasses as $class) { // if this class does a "has-one"-representation, use it if(isset($reversedComponentRelations[$class])) { + if(isset($reversedComponentRelations[$class]) && false != $reversedComponentRelations[$class]) { $joinField = $reversedComponentRelations[$class] . 'ID'; break; } @@ -867,6 +869,7 @@ class DataObject extends Controller { if($component) { $candidate = eval("return isset({$class}::\$has_many[\$component]) ? {$class}::\$has_many[\$component] : null;"); + $candidate = eval("if ( isset({$class}::\$has_many[\$component]) ) { return {$class}::\$has_many[\$component]; } else { return false; }"); if($candidate) { return $candidate; } diff --git a/forms/EditableFormField.php b/forms/EditableFormField.php index fbb1d605f..426a0477c 100755 --- a/forms/EditableFormField.php +++ b/forms/EditableFormField.php @@ -65,8 +65,11 @@ class EditableFormField extends DataObject { $titleAttr = Convert::raw2att($this->Title); $readOnlyAttr = ''; - if( $this->readonly ) + if( $this->readonly ) { $readOnlyAttr = ' disabled="disabled"'; + } else { + $readOnlyAttr = ''; + } return "ID}][Title]\"$readOnlyAttr />"; } @@ -158,7 +161,7 @@ class EditableFormField extends DataObject { foreach( $paramList as $param ) { if( preg_match( '/([^=]+)=(.+)/', $param, $match ) ) { - if( is_array( $paramMap[$match[1]] ) ) { + if( isset( $paramMap[$match[1]] ) && is_array( $paramMap[$match[1]] ) ) { $paramMap[$match[1]][] = $match[2]; } else if( isset( $paramMap[$match[1]] ) ) { $paramMap[$match[1]] = array( $paramMap[$match[1]] ); diff --git a/forms/EditableRadioOption.php b/forms/EditableRadioOption.php index 1cb69b2ba..aa7a95b6f 100755 --- a/forms/EditableRadioOption.php +++ b/forms/EditableRadioOption.php @@ -72,8 +72,11 @@ function DefaultSelect() { $disabled = ($this->readonly) ? " disabled=\"disabled\"" : ''; - if($this->Parent()->getField('Default') == $this->ID) + if($this->Parent()->getField('Default') == $this->ID) { $default = " checked=\"checked\""; + } else { + $default = ''; + } return "ParentID}][Default]\" value=\"{$this->ID}\"".$disabled.$default." />"; } diff --git a/forms/EditableTextField.php b/forms/EditableTextField.php index 336511187..e8c036a5f 100755 --- a/forms/EditableTextField.php +++ b/forms/EditableTextField.php @@ -77,6 +77,8 @@ class EditableTextField extends EditableFormField { $disabled = ''; if( $this->readonly ){ $disabled = " disabled=\"disabled\""; + } else { + $disabled = ''; } if( $this->Rows == 1 ){ return '
';