From aae4ead05383314d79ce27110cec8c428380f175 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 13 Jul 2018 09:06:34 +0200 Subject: [PATCH] Fix outdated implementation of ShowOrderFormField::options() See #2509 --- .../form/builder/field/ShowOrderFormField.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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; } -- 2.20.1