Fix multiple default values being shown on extravar edit screen

This commit is contained in:
Kijin Sung 2025-06-12 20:30:09 +09:00
parent 4c609f9827
commit 7ffe499a66
2 changed files with 2 additions and 2 deletions

View file

@ -61,7 +61,7 @@
<div class="x_control-group" data-invisible-types="file"> <div class="x_control-group" data-invisible-types="file">
<label class="x_control-label" for="default">{$lang->default_value}</label> <label class="x_control-label" for="default">{$lang->default_value}</label>
<div class="x_controls"> <div class="x_controls">
<input type="text" name="default" id="default" value="{$selected_var->default}" /> <input type="text" name="default" id="default" value="{$selected_var->getDefaultValue()}" />
<p class="x_help-block">{$lang->about_extra_vars_default_value}</p> <p class="x_help-block">{$lang->about_extra_vars_default_value}</p>
</div> </div>
</div> </div>

View file

@ -197,7 +197,7 @@ class Value
} }
elseif ($this->default) elseif ($this->default)
{ {
return array_first($this->getOptions()); return is_array($this->default) ? array_first($this->default) : array_first(explode(',', $this->default));
} }
else else
{ {