mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX WidgetAreaEditor gets it's related WidgetArea using getComponent(), a more robust way of getting the component
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@77282 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
30c95b1a65
commit
03aa331441
@ -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,15 +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;
|
||||
|
Loading…
Reference in New Issue
Block a user