#2501 + #2500 - Fixed notice-level errors in editable forms

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2@54395 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-05-13 03:07:43 +00:00
parent fb6bab202b
commit 2b576d5d36
2 changed files with 2 additions and 3 deletions

View File

@ -50,7 +50,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] );
}

View File

@ -75,8 +75,7 @@ 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 "<input class=\"radio\" type=\"radio\" name=\"Fields[{$this->ParentID}][Default]\" value=\"{$this->ID}\"".$disabled.$default." />";
}