From 81eb906bb0576efd81afa0116d25cb34c1c323ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Sun, 12 May 2019 17:18:39 +0200 Subject: [PATCH] Simplify showOrder input See #2508 --- .../lib/acp/form/ReactionTypeAddForm.class.php | 15 +-------------- .../reaction/type/ReactionTypeAction.class.php | 2 +- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php b/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php index bff6c926db..dce9282938 100644 --- a/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php @@ -72,20 +72,7 @@ class ReactionTypeAddForm extends AbstractFormBuilderForm { ShowOrderFormField::create() ->description('wcf.acp.reactionType.showOrder.description') ->required() - ->options(function () { - $list = new ReactionTypeList(); - $list->sqlOrderBy = 'showOrder ASC'; - $list->readObjects(); - - $returnValues = []; - - foreach ($list as $reactionType) { - $returnValues[$reactionType->showOrder + 1] = $reactionType->getTitle(); - } - - return $returnValues; - - }), + ->options(new ReactionTypeList()), IsDisabledFormField::create() ->label('wcf.acp.reactionType.isDisabled') ]); diff --git a/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeAction.class.php b/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeAction.class.php index 09488edd87..67262a9e1e 100644 --- a/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeAction.class.php +++ b/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeAction.class.php @@ -153,7 +153,7 @@ class ReactionTypeAction extends AbstractDatabaseObjectAction implements ISortab $sql = "UPDATE wcf" . WCF_N . "_reaction_type SET showOrder = showOrder - 1 - WHERE showOrder >= ?"; + WHERE showOrder > ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ $object->showOrder -- 2.20.1