Skip to content

Commit 0b00895

Browse files
committed
fix saving of egg variable values, closes pterodactyl#905
1 parent d9355b9 commit 0b00895

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
88
* `[rc.1]` — Fixes exception thrown when revoking user sessions.
99
* `[rc.1]` — Fixes exception that would occur when trying to delete allocations from a node.
1010
* `[rc.1]` — Fixes exception thown when attempting to adjust mail settings as well as a validation error thrown afterwards.
11+
* `[rc.1]` — Fixes bug preventing modification of the default value for an Egg variable.
1112

1213
## v0.7.0-rc.1 (Derelict Dermodactylus)
1314
### Fixed

app/Http/Requests/Admin/Egg/EggVariableFormRequest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function rules()
2020
'env_variable' => 'required|regex:/^[\w]{1,255}$/|notIn:' . EggVariable::RESERVED_ENV_NAMES,
2121
'options' => 'sometimes|required|array',
2222
'rules' => 'bail|required|string',
23+
'default_value' => 'present',
2324
];
2425
}
2526

@@ -38,10 +39,8 @@ public function withValidator($validator)
3839
// If rules is not a string it is already violating the rule defined above
3940
// so just skip the addition of default value rules since this request
4041
// will fail anyways.
41-
if (! is_string($rules)) {
42-
return;
43-
}
44-
45-
$validator->addRules(['default_value' => $rules]);
42+
$validator->sometimes('default_value', $rules, function () use ($rules) {
43+
return is_string($rules);
44+
});
4645
}
4746
}

0 commit comments

Comments
 (0)