From b7b3678b26594e798ca61396981815f64ba3e688 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 15 Sep 2017 17:03:20 +1200 Subject: [PATCH] =?UTF-8?q?BUG=20Fix=20casting=20for=20=E2=80=98$Attribute?= =?UTF-8?q?s=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GridFieldAddNewInlineButton.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/GridFieldAddNewInlineButton.php b/src/GridFieldAddNewInlineButton.php index 6e7d6e6..3baf298 100755 --- a/src/GridFieldAddNewInlineButton.php +++ b/src/GridFieldAddNewInlineButton.php @@ -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' ))); }