Skip to content

Commit

Permalink
BUG Fix casting for ‘$Attributes’
Browse files Browse the repository at this point in the history
Damian Mooyman committed Sep 15, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 37b35f6 commit b7b3678
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/GridFieldAddNewInlineButton.php
Original file line number Diff line number Diff line change
@@ -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'
)));
}

0 comments on commit b7b3678

Please sign in to comment.