FIX Submitted form field values are no longer double escaped in the CMS

This commit is contained in:
Robbie Averill 2018-08-15 17:00:49 +12:00
parent 7e91be9cb4
commit ab402b117c
1 changed files with 7 additions and 9 deletions

View File

@ -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
* <brs> so they will output as newlines in the reports
* <brs> 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()
{