1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-25 18:42:31 +01:00

using the placeholder value if nothing is specified in rules on a new variable fixes #564

This commit is contained in:
kasper Franz 2017-08-26 10:16:09 +02:00
parent b2429f1b55
commit 3de57df3d0
2 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,9 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
* Support for CS:GO as a default service option selection.
* Support for GMOD as a default service option selection.
### Fixed
* Using default value in rules when creating a new variable if the rules is empty.
## v0.6.4 (Courageous Carniadactylus)
### Fixed
* Fixed the console rendering on page load, I guess people don't like watching it load line-by-line for 10 minutes. Who would have guessed...

View File

@ -47,6 +47,11 @@ class VariableRepository
{
$option = ServiceOption::select('id')->findOrFail($option);
// If there is not a rules present let's populate it with the default/placeholder value.
if(!array_key_exists('rules',$data) || empty($data['rules'])){
$data['rules'] = 'required|string|max:20';
}
$validator = Validator::make($data, [
'name' => 'required|string|min:1|max:255',
'description' => 'sometimes|nullable|string',