From: Matthias Schmidt Date: Fri, 13 Jul 2018 07:06:34 +0000 (+0200) Subject: Fix outdated implementation of ShowOrderFormField::options() X-Git-Tag: 5.2.0_Alpha_1~680^2~11 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aae4ead05383314d79ce27110cec8c428380f175;p=GitHub%2FWoltLab%2FWCF.git Fix outdated implementation of ShowOrderFormField::options() See #2509 --- diff --git a/wcfsetup/install/files/lib/system/form/builder/field/ShowOrderFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/ShowOrderFormField.class.php index f0697f716e..015c2820a6 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/ShowOrderFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/ShowOrderFormField.class.php @@ -64,11 +64,17 @@ class ShowOrderFormField extends SingleSelectionFormField { * and using the language item `wcf.form.field.showOrder.firstPosition` * as value to mark adding it at the first position. */ - public function options($options): ISelectionFormField { - parent::options($options); + public function options($options, bool $nestedOptions = false): ISelectionFormField { + parent::options($options, $nestedOptions); $this->__options = [0 => WCF::getLanguage()->get('wcf.form.field.showOrder.firstPosition')] + $this->__options; - $this->possibleValues[] = 0; + if ($nestedOptions) { + array_unshift($this->__nestedOptions, [ + 'depth' => 0, + 'label' => WCF::getLanguage()->get('wcf.form.field.showOrder.firstPosition'), + 'value' => 0 + ]); + } return $this; }