Use default startup variable value when creating server via api (#1518)

Co-authored-by: Boy132 <mail@boy132.de>
This commit is contained in:
Lance Pioch 2025-07-19 13:58:04 -04:00 committed by GitHub
parent 71d0326cb2
commit 986063dce4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class VariableValidatorService
$data = $rules = $customAttributes = [];
foreach ($variables as $variable) {
$data['environment'][$variable->env_variable] = array_get($fields, $variable->env_variable);
$data['environment'][$variable->env_variable] = $fields[$variable->env_variable] ?? $variable->default_value;
$rules['environment.' . $variable->env_variable] = $variable->rules;
$customAttributes['environment.' . $variable->env_variable] = trans('validation.internal.variable_value', ['env' => $variable->name]);
}

View File

@ -34,6 +34,7 @@ class VariableValidatorServiceTest extends IntegrationTestCase
try {
$this->getService()->handle($egg->id, [
'BUNGEE_VERSION' => '1.2.3',
'SERVER_JARFILE' => '',
]);
$this->fail('This statement should not be reached.');