From: Joshua Rüsweg Date: Sun, 12 May 2019 15:18:39 +0000 (+0200) Subject: Simplify showOrder input X-Git-Tag: 5.2.0_Alpha_1~93 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=81eb906bb0576efd81afa0116d25cb34c1c323ec;p=GitHub%2FWoltLab%2FWCF.git Simplify showOrder input See #2508 --- 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