mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
FIX Do not override core translation for 'field is required'
This commit is contained in:
parent
76540d8ffc
commit
f734c2f033
@ -27,6 +27,7 @@ use SilverStripe\ORM\ArrayList;
|
|||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
use SilverStripe\ORM\DB;
|
use SilverStripe\ORM\DB;
|
||||||
use SilverStripe\ORM\FieldType\DBField;
|
use SilverStripe\ORM\FieldType\DBField;
|
||||||
|
use SilverStripe\ORM\FieldType\DBVarchar;
|
||||||
use SilverStripe\ORM\ValidationException;
|
use SilverStripe\ORM\ValidationException;
|
||||||
use SilverStripe\UserForms\Extension\UserFormFieldEditorExtension;
|
use SilverStripe\UserForms\Extension\UserFormFieldEditorExtension;
|
||||||
use SilverStripe\UserForms\Model\EditableFormField\EditableFieldGroup;
|
use SilverStripe\UserForms\Model\EditableFormField\EditableFieldGroup;
|
||||||
@ -801,12 +802,12 @@ class EditableFormField extends DataObject
|
|||||||
* Return the error message for this field. Either uses the custom
|
* Return the error message for this field. Either uses the custom
|
||||||
* one (if provided) or the default SilverStripe message
|
* one (if provided) or the default SilverStripe message
|
||||||
*
|
*
|
||||||
* @return Varchar
|
* @return DBVarchar
|
||||||
*/
|
*/
|
||||||
public function getErrorMessage()
|
public function getErrorMessage()
|
||||||
{
|
{
|
||||||
$title = strip_tags("'". ($this->Title ? $this->Title : $this->Name) . "'");
|
$title = strip_tags("'". ($this->Title ? $this->Title : $this->Name) . "'");
|
||||||
$standard = _t('SilverStripe\\Forms\\Form.FIELDISREQUIRED', '{name} is required.', ['name' => $title]);
|
$standard = _t(__CLASS__ . '.FIELDISREQUIRED', '{name} is required', ['name' => $title]);
|
||||||
|
|
||||||
// only use CustomErrorMessage if it has a non empty value
|
// only use CustomErrorMessage if it has a non empty value
|
||||||
$errorMessage = (!empty($this->CustomErrorMessage)) ? $this->CustomErrorMessage : $standard;
|
$errorMessage = (!empty($this->CustomErrorMessage)) ? $this->CustomErrorMessage : $standard;
|
||||||
|
@ -3,8 +3,6 @@ en:
|
|||||||
SELECTUPLOADFOLDER: 'Select upload folder'
|
SELECTUPLOADFOLDER: 'Select upload folder'
|
||||||
SilverStripe\CMS\Model\SiteTree:
|
SilverStripe\CMS\Model\SiteTree:
|
||||||
TABMAIN: Main
|
TABMAIN: Main
|
||||||
SilverStripe\Forms\Form:
|
|
||||||
FIELDISREQUIRED: '{name} is required.'
|
|
||||||
SilverStripe\UserForms:
|
SilverStripe\UserForms:
|
||||||
ADDEMAILRECIPIENT: 'Add Email Recipient'
|
ADDEMAILRECIPIENT: 'Add Email Recipient'
|
||||||
CLEARBUTTON: Clear
|
CLEARBUTTON: Clear
|
||||||
@ -57,6 +55,7 @@ en:
|
|||||||
EXTRACLASS_SELECT: 'Select from the list of allowed styles'
|
EXTRACLASS_SELECT: 'Select from the list of allowed styles'
|
||||||
EXTRACLASS_TITLE: 'Extra Styling/Layout'
|
EXTRACLASS_TITLE: 'Extra Styling/Layout'
|
||||||
EXTRACLASS_Title: 'Extra CSS classes'
|
EXTRACLASS_Title: 'Extra CSS classes'
|
||||||
|
FIELDISREQUIRED: '{name} is required'
|
||||||
GROUP: Group
|
GROUP: Group
|
||||||
INITIALVISIBILITY: 'Initial visibility'
|
INITIALVISIBILITY: 'Initial visibility'
|
||||||
MERGEFIELDNAME: 'Merge field'
|
MERGEFIELDNAME: 'Merge field'
|
||||||
|
Loading…
Reference in New Issue
Block a user