Fixed sorting by user options
authorMarcel Werk <burntime@woltlab.com>
Fri, 28 Aug 2015 13:10:04 +0000 (15:10 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 28 Aug 2015 13:10:04 +0000 (15:10 +0200)
wcfsetup/install/files/lib/acp/page/UserListPage.class.php

index a38c4ed8ab5d5b1df87699ef3a9be42f97c5264f..86e885a4112956f61938e4dfc026b663ff393a3d 100755 (executable)
@@ -208,7 +208,7 @@ class UserListPage extends SortablePage {
                        FROM            wcf".WCF_N."_user user_table
                        ".(isset($this->options[$this->sortField]) ? "LEFT JOIN wcf".WCF_N."_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)" : '')."
                        ".$this->conditions."
-                       ORDER BY        ".(($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'user_option_value.userOption'.$this->options[$this->sortField]['optionID'] : $this->sortField)." ".$this->sortOrder;
+                       ORDER BY        ".(($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'user_option_value.userOption'.$this->options[$this->sortField]->optionID : $this->sortField)." ".$this->sortOrder;
                $statement = WCF::getDB()->prepareStatement($sql, $this->itemsPerPage, ($this->pageNo - 1) * $this->itemsPerPage);
                $statement->execute($this->conditions->getParameters());
                while ($row = $statement->fetchArray()) {
@@ -239,7 +239,7 @@ class UserListPage extends SortablePage {
                                LEFT JOIN       wcf".WCF_N."_user_avatar user_avatar
                                ON              (user_avatar.avatarID = user_table.avatarID)
                                ".$conditions."
-                               ORDER BY        ".(($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'option_value.userOption'.$this->options[$this->sortField]['optionID'] : 'user_table.'.$this->sortField)." ".$this->sortOrder;
+                               ORDER BY        ".(($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'option_value.userOption'.$this->options[$this->sortField]->optionID : 'user_table.'.$this->sortField)." ".$this->sortOrder;
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($conditions->getParameters());
                        while ($row = $statement->fetchArray()) {