mirror of
https://github.com/pelican-dev/panel.git
synced 2025-08-03 00:12:19 +02:00
Use default startup variable value when creating server via api (#1518)
Co-authored-by: Boy132 <mail@boy132.de>
This commit is contained in:
parent
71d0326cb2
commit
986063dce4
@ -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]);
|
||||
}
|
||||
|
@ -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.');
|
||||
|
Loading…
x
Reference in New Issue
Block a user