Merge pull request #214 from open-sausages/pulls/2.0/better-casting

BUG Fix casting for ‘$Attributes’
This commit is contained in:
Robbie Averill 2017-09-15 17:35:17 +12:00 committed by GitHub
commit 39dddc4c91

View File

@ -144,8 +144,10 @@ class GridFieldAddNewInlineButton implements GridField_HTMLProvider, GridField_S
sprintf('[%s][{%%=o.num%%}]', self::POST_KEY),
$content
);
}
// Cast content as HTML
// Cast content
if (! $content instanceof DBField) {
$content = DBField::create_field('HTMLFragment', $content);
}
@ -157,7 +159,7 @@ class GridFieldAddNewInlineButton implements GridField_HTMLProvider, GridField_S
$columns->push(new ArrayData(array(
'Content' => $content,
'Attributes' => $attrs,
'Attributes' => DBField::create_field('HTMLFragment', $attrs),
'IsActions' => $column == 'Actions'
)));
}