Merged from branches/2.3

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@77455 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-05-21 00:17:27 +00:00
parent 8282a61ddf
commit 9207cbc2da

View File

@ -26,9 +26,7 @@ class WidgetAreaEditor extends FormField {
function UsedWidgets() {
$relationName = $this->name;
$widgets = $this->form->getRecord()->$relationName()->Widgets();
$widgets = $this->form->getRecord()->getComponent($relationName)->Widgets();
return $widgets;
}
@ -38,14 +36,14 @@ class WidgetAreaEditor extends FormField {
function Value() {
$relationName = $this->name;
return $this->form->getRecord()->$relationName()->ID;
return $this->form->getRecord()->getComponent($relationName)->ID;
}
function saveInto(DataObject $record) {
$name = $this->name;
$idName = $name . "ID";
$widgetarea = $record->$name();
$widgetarea = $record->getComponent($name);
$widgetarea->write();
$record->$idName = $widgetarea->ID;
@ -112,4 +110,4 @@ class WidgetAreaEditor extends FormField {
}
}
}
?>
?>