BUGFIX Fixed quoting in WidgetAreaEditor

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@77991 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-05-27 21:26:07 +00:00
parent 40a2c3bb7c
commit a1f8fb3049

View File

@ -73,7 +73,11 @@ class WidgetAreaEditor extends FormField {
// \"ParentID\" = '0' is for the new page // \"ParentID\" = '0' is for the new page
$widget = DataObject::get_one( $widget = DataObject::get_one(
'Widget', 'Widget',
"(\"ParentID\" = '{$record->$name()->ID}' OR \"ParentID\" = '0') AND \"Widget\".\"ID\" = '$newWidgetID'" sprintf(
'("ParentID" = %d OR "ParentID" = 0) AND "Widget"."ID" = %d',
$record->$name()->ID,
(int)$newWidgetID
)
); );
// check if we are updating an existing widget // check if we are updating an existing widget