fix saving of egg variable values, closes #905

This commit is contained in:
Dane Everitt 2018-02-03 12:36:57 -06:00
parent d9355b93b4
commit 0b00895261
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 5 additions and 5 deletions

View file

@ -8,6 +8,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
* `[rc.1]` — Fixes exception thrown when revoking user sessions.
* `[rc.1]` — Fixes exception that would occur when trying to delete allocations from a node.
* `[rc.1]` — Fixes exception thown when attempting to adjust mail settings as well as a validation error thrown afterwards.
* `[rc.1]` — Fixes bug preventing modification of the default value for an Egg variable.
## v0.7.0-rc.1 (Derelict Dermodactylus)
### Fixed

View file

@ -20,6 +20,7 @@ class EggVariableFormRequest extends AdminFormRequest
'env_variable' => 'required|regex:/^[\w]{1,255}$/|notIn:' . EggVariable::RESERVED_ENV_NAMES,
'options' => 'sometimes|required|array',
'rules' => 'bail|required|string',
'default_value' => 'present',
];
}
@ -38,10 +39,8 @@ class EggVariableFormRequest extends AdminFormRequest
// If rules is not a string it is already violating the rule defined above
// so just skip the addition of default value rules since this request
// will fail anyways.
if (! is_string($rules)) {
return;
}
$validator->addRules(['default_value' => $rules]);
$validator->sometimes('default_value', $rules, function () use ($rules) {
return is_string($rules);
});
}
}