From b078262c1e1df53af8bc04d631582ec0cf12517f Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Wed, 25 Jun 2008 03:56:57 +0000 Subject: [PATCH] Merged revisions 54402 via svnmerge from svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2 ........ r54402 | sminnee | 2008-05-13 15:07:43 +1200 (Tue, 13 May 2008) | 1 line #2501 + #2500 - Fixed notice-level errors in editable forms ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@56904 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/editor/EditableDropdown.php | 4 ++-- forms/editor/EditableDropdownOption.php | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/forms/editor/EditableDropdown.php b/forms/editor/EditableDropdown.php index eda786863..c0d3f6713 100755 --- a/forms/editor/EditableDropdown.php +++ b/forms/editor/EditableDropdown.php @@ -44,7 +44,7 @@ class EditableDropdown extends EditableFormField { } if(isset($data[$option->ID])) { - $option->setField( 'Default', $option->ID == $data['Default'] ); + $option->setField('Default', isset($data['Default']) ? ($option->ID == $data['Default']) : false); $option->populateFromPostData( $data[$option->ID] ); } @@ -124,4 +124,4 @@ class EditableDropdown extends EditableFormField { return $clonedNode; } } -?> \ No newline at end of file +?> diff --git a/forms/editor/EditableDropdownOption.php b/forms/editor/EditableDropdownOption.php index 0c2f20a00..7d1bfd02b 100755 --- a/forms/editor/EditableDropdownOption.php +++ b/forms/editor/EditableDropdownOption.php @@ -69,10 +69,9 @@ class EditableDropdownOption extends DataObject { function DefaultSelect() { $disabled = ($this->readonly) ? " disabled=\"disabled\"" : ''; - if( $this->Parent()->getField('Default') == $this->ID ) - $default = " checked=\"checked\""; + $default = ($this->Parent()->getField('Default') == $this->ID) ? " checked=\"checked\"" : ""; return "ParentID}][Default]\" value=\"{$this->ID}\"".$disabled.$default." />"; } } -?> \ No newline at end of file +?>