diff --git a/CHANGELOG.md b/CHANGELOG.md index a5d23238b..99ab4afc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/app/Http/Requests/Admin/Egg/EggVariableFormRequest.php b/app/Http/Requests/Admin/Egg/EggVariableFormRequest.php index bc876e2a7..a8047f55d 100644 --- a/app/Http/Requests/Admin/Egg/EggVariableFormRequest.php +++ b/app/Http/Requests/Admin/Egg/EggVariableFormRequest.php @@ -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); + }); } }