Skip to content

Commit d52f8d9

Browse files
committed
Fix behavior of validation when creating egg variables
1 parent 303b64c commit d52f8d9

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1919

2020
### Changed
2121
* PHP 7.2 is now the minimum required version for this software.
22+
* Egg variable default values are no longer validated aganist the ruleset when configuring them. Validation of those rules will only occur when editing or creating a server.
2223

2324
## v0.7.0-rc.2 (Derelict Dermodactylus)
2425
### Fixed

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,4 @@ public function rules()
2323
'default_value' => 'present',
2424
];
2525
}
26-
27-
/**
28-
* Run validation after the rules above have been applied.
29-
*
30-
* @param \Illuminate\Validation\Validator $validator
31-
*/
32-
public function withValidator($validator)
33-
{
34-
$rules = $this->input('rules');
35-
if ($this->method() === 'PATCH') {
36-
$rules = $this->input('rules', $this->route()->parameter('egg')->rules);
37-
}
38-
39-
// If rules is not a string it is already violating the rule defined above
40-
// so just skip the addition of default value rules since this request
41-
// will fail anyways.
42-
$validator->sometimes('default_value', $rules, function () use ($rules) {
43-
return is_string($rules);
44-
});
45-
}
4626
}

0 commit comments

Comments
 (0)