BUG Fix casting for ‘$Attributes’

This commit is contained in:
Damian Mooyman 2017-09-15 17:03:20 +12:00
parent 37b35f6a46
commit b7b3678b26
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

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