Fixes a bug that would cause non-editable variables on the front-end to throw a validation error
This commit is contained in:
parent
e2cdb3b4b1
commit
8e1aa15dba
4 changed files with 14 additions and 3 deletions
|
@ -76,6 +76,12 @@ class VariableValidatorService
|
|||
|
||||
$data = $rules = $customAttributes = [];
|
||||
foreach ($variables as $variable) {
|
||||
// Don't attempt to validate variables if they aren't user editable
|
||||
// and we're not running this at an admin level.
|
||||
if (! $variable->user_editable && ! $this->isUserLevel(User::USER_LEVEL_ADMIN)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$data['environment'][$variable->env_variable] = array_get($fields, $variable->env_variable);
|
||||
$rules['environment.' . $variable->env_variable] = $variable->rules;
|
||||
$customAttributes['environment.' . $variable->env_variable] = trans('validation.internal.variable_value', ['env' => $variable->name]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue