diff --git a/src/GridFieldAddNewInlineButton.php b/src/GridFieldAddNewInlineButton.php index 6e7d6e62..3baf2984 100755 --- a/src/GridFieldAddNewInlineButton.php +++ b/src/GridFieldAddNewInlineButton.php @@ -144,8 +144,10 @@ private function getRowTemplate(GridField $grid, GridFieldEditableColumns $edita 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 @@ private function getRowTemplate(GridField $grid, GridFieldEditableColumns $edita $columns->push(new ArrayData(array( 'Content' => $content, - 'Attributes' => $attrs, + 'Attributes' => DBField::create_field('HTMLFragment', $attrs), 'IsActions' => $column == 'Actions' ))); }