From ab402b117c9fc510e20a2f80ff2243f1fa5a43f3 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Wed, 15 Aug 2018 17:00:49 +1200 Subject: [PATCH] FIX Submitted form field values are no longer double escaped in the CMS --- code/Model/Submission/SubmittedFormField.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/code/Model/Submission/SubmittedFormField.php b/code/Model/Submission/SubmittedFormField.php index 7085ae9..1be0cd7 100755 --- a/code/Model/Submission/SubmittedFormField.php +++ b/code/Model/Submission/SubmittedFormField.php @@ -3,7 +3,9 @@ namespace SilverStripe\UserForms\Model\Submission; use SilverStripe\ORM\DataObject; -use SilverStripe\UserForms\Model\Submission\SubmittedForm; +use SilverStripe\ORM\FieldType\DBField; +use SilverStripe\Security\Member; +use SilverStripe\UserForms\Model\EditableFormField; /** * Data received from a UserDefinedForm submission @@ -27,10 +29,6 @@ class SubmittedFormField extends DataObject 'FormattedValue' => 'Value' ]; - private static $casting = [ - 'FormattedValue' => 'HTMLFragment' - ]; - private static $table_name = 'SubmittedFormField'; /** @@ -76,20 +74,20 @@ class SubmittedFormField extends DataObject /** * Generate a formatted value for the reports and email notifications. * Converts new lines (which are stored in the database text field) as - * so they will output as newlines in the reports + * so they will output as newlines in the reports. * - * @return string + * @return DBField */ public function getFormattedValue() { - return nl2br($this->dbObject('Value')->ATT()); + return $this->dbObject('Value'); } /** * Return the value of this submitted form field suitable for inclusion * into the CSV * - * @return Text + * @return DBField */ public function getExportValue() {