Merge pull request #1102 from lerni/OnCompleteMessage-in-populateDefaults()

ENH Move OnCompleteMessage from $defaults to populateDefaults() for translations
This commit is contained in:
Michal Kleiner 2022-03-17 10:37:22 +13:00 committed by GitHub
commit 81c21ea463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,7 +110,6 @@ trait UserForm
private static $defaults = [
'Content' => '$UserDefinedForm',
'DisableSaveSubmissions' => 0,
'OnCompleteMessage' => '<p>Thanks, we\'ve received your submission.</p>'
];
/**
@ -167,6 +166,15 @@ trait UserForm
*/
protected $fieldsFromTo = [];
/**
* @var array
*/
public function populateDefaults()
{
parent::populateDefaults();
$this->OnCompleteMessage = '<p>' . _t('SilverStripe\\UserForms\\Model\\UserDefinedForm.ONCOMPLETEMESSAGE', 'Thanks, we\'ve received your submission.') . '</p>';
}
/**
* @return FieldList
*/