Minor linting adjustment.

This commit is contained in:
Maxime Rainville 2020-01-14 12:28:04 +13:00
parent 39ee08cff9
commit e2c05d5a55
2 changed files with 14 additions and 18 deletions

View File

@ -134,21 +134,17 @@ class UserFormsRequiredFields extends RequiredFields
$errorMessage = _t(
'SilverStripe\\Forms\\Form.FIELDISREQUIRED',
'{name} is required',
array(
[
'name' => strip_tags(
'"' . ($formField->Title() ? $formField->Title() : $fieldName) . '"'
)
)
]
);
if ($msg = $formField->getCustomValidationMessage()) {
$errorMessage = $msg;
}
$this->validationError(
$fieldName,
$errorMessage,
"required"
);
$this->validationError($fieldName, $errorMessage, "required");
}
}

View File

@ -25,24 +25,24 @@ use SilverStripe\Versioned\Versioned;
class EditableCustomRule extends DataObject
{
private static $condition_options = [
'IsBlank' => 'Is blank',
'IsNotBlank' => 'Is not blank',
'HasValue' => 'Equals',
'ValueNot' => 'Doesn\'t equal',
'ValueLessThan' => 'Less than',
'ValueLessThanEqual' => 'Less than or equal',
'ValueGreaterThan' => 'Greater than',
'IsBlank' => 'Is blank',
'IsNotBlank' => 'Is not blank',
'HasValue' => 'Equals',
'ValueNot' => 'Doesn\'t equal',
'ValueLessThan' => 'Less than',
'ValueLessThanEqual' => 'Less than or equal',
'ValueGreaterThan' => 'Greater than',
'ValueGreaterThanEqual' => 'Greater than or equal'
];
private static $db = [
'Display' => 'Enum("Show,Hide")',
'Display' => 'Enum("Show,Hide")',
'ConditionOption' => 'Enum("IsBlank,IsNotBlank,HasValue,ValueNot,ValueLessThan,ValueLessThanEqual,ValueGreaterThan,ValueGreaterThanEqual")',
'FieldValue' => 'Varchar(255)'
'FieldValue' => 'Varchar(255)'
];
private static $has_one = [
'Parent' => EditableFormField::class,
'Parent' => EditableFormField::class,
'ConditionField' => EditableFormField::class
];
@ -240,7 +240,7 @@ class EditableCustomRule extends DataObject
* @return boolean
* @throws LogicException Invalid ConditionOption is set for this rule.
*/
public function validateAgainstFormData($data)
public function validateAgainstFormData(array $data)
{
$controllingField = $this->ConditionField();