diff --git a/file/lib/acp/page/RoomListPage.class.php b/file/lib/acp/page/RoomListPage.class.php index 468f308..7bb93b2 100644 --- a/file/lib/acp/page/RoomListPage.class.php +++ b/file/lib/acp/page/RoomListPage.class.php @@ -38,7 +38,7 @@ public function readData() { parent::readData(); $this->objects = new \chat\data\room\RoomList(); - $this->objects->sqlOrder = 'position ASC'; + $this->objects->sqlOrderBy = 'position ASC'; $this->objects->readObjects(); } diff --git a/file/lib/data/room/RoomAction.class.php b/file/lib/data/room/RoomAction.class.php index 1848c28..47a2ba3 100644 --- a/file/lib/data/room/RoomAction.class.php +++ b/file/lib/data/room/RoomAction.class.php @@ -98,8 +98,6 @@ public function validateUpdatePosition() { if (!isset($this->parameters['data']['structure'])) { throw new \wcf\system\exception\UserInputException('structure'); } - - if (!isset($this->parameters['data']['offset'])) $this->parameters['data']['offset'] = 0; } /** @@ -107,14 +105,14 @@ public function validateUpdatePosition() { */ public function updatePosition() { $roomList = new RoomList(); - $roomList->sqlOrderBy = "room.position"; $roomList->readObjects(); - $i = $this->parameters['data']['offset']; + $i = 0; WCF::getDB()->beginTransaction(); foreach ($this->parameters['data']['structure'][0] as $roomID) { $room = $roomList->search($roomID); if ($room === null) continue; + $editor = new RoomEditor($room); $editor->update(array('position' => $i++)); }