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
This commit is contained in:
Andrew O'Neil 2008-06-25 03:56:57 +00:00
parent b11956268e
commit b078262c1e
2 changed files with 4 additions and 5 deletions

View File

@ -44,7 +44,7 @@ class EditableDropdown extends EditableFormField {
} }
if(isset($data[$option->ID])) { 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] ); $option->populateFromPostData( $data[$option->ID] );
} }

View File

@ -69,8 +69,7 @@ class EditableDropdownOption extends DataObject {
function DefaultSelect() { function DefaultSelect() {
$disabled = ($this->readonly) ? " disabled=\"disabled\"" : ''; $disabled = ($this->readonly) ? " disabled=\"disabled\"" : '';
if( $this->Parent()->getField('Default') == $this->ID ) $default = ($this->Parent()->getField('Default') == $this->ID) ? " checked=\"checked\"" : "";
$default = " checked=\"checked\"";
return "<input class=\"radio\" type=\"radio\" name=\"Fields[{$this->ParentID}][Default]\" value=\"{$this->ID}\"".$disabled.$default." />"; return "<input class=\"radio\" type=\"radio\" name=\"Fields[{$this->ParentID}][Default]\" value=\"{$this->ID}\"".$disabled.$default." />";
} }