From 6ec02da577c0561cd62e001400f7ac425ef15cbe Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Fri, 2 Aug 2019 17:46:56 +1200 Subject: [PATCH] FIX: Allow multi-line content in grid field cells MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s amazing that this but has been present for 7 years, but there you go! --- src/Forms/GridField/GridFieldDataColumns.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Forms/GridField/GridFieldDataColumns.php b/src/Forms/GridField/GridFieldDataColumns.php index c8dd223da..b908dcf4b 100644 --- a/src/Forms/GridField/GridFieldDataColumns.php +++ b/src/Forms/GridField/GridFieldDataColumns.php @@ -253,14 +253,14 @@ class GridFieldDataColumns implements GridField_ColumnProvider // If the value is an object, we do one of two things if (method_exists($value, 'Nice')) { // If it has a "Nice" method, call that & make sure the result is safe - $value = Convert::raw2xml($value->Nice()); + $value = nl2br(Convert::raw2xml($value->Nice())); } else { // Otherwise call forTemplate - the result of this should already be safe $value = $value->forTemplate(); } } else { // Otherwise, just treat as a text string & make sure the result is safe - $value = Convert::raw2xml($value); + $value = nl2br(Convert::raw2xml($value)); } return $value;