From d3bd0a85177db77335b5f018bb85e3f538fdcdfd Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 4 Feb 2021 18:08:56 +0100 Subject: [PATCH] Split additional joins into multiple lines --- .../files/lib/acp/form/UserSearchForm.class.php | 4 +++- .../lib/acp/page/CronjobLogListPage.class.php | 4 +++- .../files/lib/acp/page/LabelListPage.class.php | 4 +++- ...SubscriptionTransactionLogListPage.class.php | 7 +++++-- .../page/PaidSubscriptionUserListPage.class.php | 7 +++++-- .../files/lib/acp/page/TagListPage.class.php | 7 +++++-- .../files/lib/acp/page/UserListPage.class.php | 5 ++++- .../lib/acp/page/UserRankListPage.class.php | 4 +++- .../data/article/ViewableArticleList.class.php | 11 +++++++++-- .../AdministrativeAttachmentList.class.php | 4 +++- .../files/lib/data/media/MediaList.class.php | 4 +++- .../lib/data/media/ViewableMediaList.class.php | 5 ++++- .../queue/ViewableModerationQueueList.class.php | 7 +++++-- .../lib/data/template/TemplateList.class.php | 7 +++++-- .../lib/data/trophy/TrophyAction.class.php | 7 +++++-- .../files/lib/data/user/UserList.class.php | 4 +++- .../lib/data/user/UserProfileList.class.php | 12 +++++++++--- .../data/user/follow/UserFollowerList.class.php | 7 +++++-- .../user/follow/UserFollowingList.class.php | 14 ++++++++++---- .../ignore/ViewableUserIgnoreList.class.php | 14 ++++++++++---- ...UserNotificationEventRecipientList.class.php | 4 +++- .../data/user/online/UsersOnlineList.class.php | 17 ++++++++++++----- .../visitor/UserProfileVisitorList.class.php | 7 +++++-- .../data/user/trophy/UserTrophyAction.class.php | 16 ++++++++++++---- .../data/user/trophy/UserTrophyList.class.php | 16 ++++++++++++---- .../lib/page/UnreadArticleListPage.class.php | 6 +++++- .../ArticleCommentListBoxController.class.php | 7 +++++-- .../ProfileCommentListBoxController.class.php | 4 +++- .../box/UserTrophyListBoxController.class.php | 16 ++++++++++++---- .../builder/CategoryCacheBuilder.class.php | 4 +++- .../category/TrophyCategoryType.class.php | 7 +++++-- ...xpiringPaidSubscriptionUserCronjob.class.php | 4 +++- .../lib/system/importer/ImportHandler.class.php | 5 ++++- .../queue/ModerationQueueManager.class.php | 5 ++++- .../page/handler/TrophyPageHandler.class.php | 4 +++- .../files/lib/system/poll/PollManager.class.php | 5 ++++- .../lib/system/search/ArticleSearch.class.php | 4 +++- .../lib/system/search/PageSearch.class.php | 4 +++- .../MultilingualPageSitemapObject.class.php | 8 ++++++-- .../condition/TrophyConditionHandler.class.php | 8 ++++++-- .../worker/UserRebuildDataWorker.class.php | 4 +++- 41 files changed, 218 insertions(+), 75 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php b/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php index e04bb9017b..db671baa14 100755 --- a/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php @@ -270,7 +270,9 @@ class UserSearchForm extends UserOptionListForm protected function search() { $this->userList = new UserList(); - $this->userList->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; + $this->userList->sqlConditionJoins .= " + LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + ON user_option_value.userID = user_table.userID"; $this->userList->sqlLimit = $this->maxResults; EventHandler::getInstance()->fireAction($this, 'search'); diff --git a/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php b/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php index 68f2edd2d2..bdc23ba403 100755 --- a/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php @@ -93,7 +93,9 @@ class CronjobLogListPage extends SortablePage parent::initObjectList(); $this->objectList->sqlSelects = "cronjob.*"; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_cronjob cronjob ON cronjob.cronjobID = cronjob_log.cronjobID"; + $this->objectList->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_cronjob cronjob + ON cronjob.cronjobID = cronjob_log.cronjobID"; if ($this->cronjobID) { $this->objectList->getConditionBuilder()->add('cronjob_log.cronjobID = ?', [$this->cronjobID]); diff --git a/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php b/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php index a50f0af191..78d0c522c9 100644 --- a/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php @@ -110,7 +110,9 @@ class LabelListPage extends SortablePage parent::initObjectList(); $this->objectList->sqlSelects = "label_group.groupName, label_group.groupDescription"; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_label_group label_group ON label_group.groupID = label.groupID"; + $this->objectList->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_label_group label_group + ON label_group.groupID = label.groupID"; if ($this->labelGroup) { $this->objectList->getConditionBuilder()->add('label.groupID = ?', [$this->labelGroup->groupID]); diff --git a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php index 52e3001cf8..e04687ae5c 100644 --- a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php @@ -131,8 +131,11 @@ class PaidSubscriptionTransactionLogListPage extends SortablePage } $this->objectList->sqlSelects = 'user_table.username, paid_subscription.title'; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = paid_subscription_transaction_log.userID"; - $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_transaction_log.subscriptionID"; + $this->objectList->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = paid_subscription_transaction_log.userID + LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription + ON paid_subscription.subscriptionID = paid_subscription_transaction_log.subscriptionID"; } /** diff --git a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php index d60b5a29aa..66c1516f74 100644 --- a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php @@ -103,8 +103,11 @@ class PaidSubscriptionUserListPage extends SortablePage $this->objectList->getConditionBuilder()->add('paid_subscription_user.isActive = ?', [1]); $this->objectList->sqlSelects = 'user_table.username, paid_subscription.title'; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = paid_subscription_user.userID"; - $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_user.subscriptionID"; + $this->objectList->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = paid_subscription_user.userID + LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription + ON paid_subscription.subscriptionID = paid_subscription_user.subscriptionID"; } /** diff --git a/wcfsetup/install/files/lib/acp/page/TagListPage.class.php b/wcfsetup/install/files/lib/acp/page/TagListPage.class.php index f5b9532154..8cd6e700a7 100644 --- a/wcfsetup/install/files/lib/acp/page/TagListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/TagListPage.class.php @@ -96,8 +96,11 @@ class TagListPage extends SortablePage $this->objectList->sqlSelects .= ", language.languageName, language.languageCode"; $this->objectList->sqlSelects .= ", synonym.name AS synonymName"; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_language language ON tag.languageID = language.languageID"; - $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_tag synonym ON tag.synonymFor = synonym.tagID"; + $this->objectList->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_language language + ON tag.languageID = language.languageID + LEFT JOIN wcf" . WCF_N . "_tag synonym + ON tag.synonymFor = synonym.tagID"; if ($this->search !== '') { $this->objectList->getConditionBuilder()->add('tag.name LIKE ?', [$this->search . '%']); diff --git a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php index d625a148c4..0592ee4892 100755 --- a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php @@ -260,7 +260,10 @@ class UserListPage extends SortablePage // get user ids $sql = "SELECT user_table.userID 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" : '') . " + " . (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; $statement = WCF::getDB()->prepareStatement( diff --git a/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php index a6476722cc..b4d081d6f6 100644 --- a/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php @@ -55,6 +55,8 @@ class UserRankListPage extends SortablePage parent::initObjectList(); $this->objectList->sqlSelects = 'user_group.groupName'; - $this->objectList->sqlJoins = 'LEFT JOIN wcf' . WCF_N . '_user_group user_group ON user_group.groupID = user_rank.groupID'; + $this->objectList->sqlJoins = ' + LEFT JOIN wcf' . WCF_N . '_user_group user_group + ON user_group.groupID = user_rank.groupID'; } } diff --git a/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php b/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php index 58daaabc45..21986ea38d 100644 --- a/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php +++ b/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php @@ -49,14 +49,21 @@ class ViewableArticleList extends ArticleList $this->sqlSelects .= ','; } $this->sqlSelects .= 'tracked_visit.visitTime'; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit + ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " + AND tracked_visit.objectID = article.articleID + AND tracked_visit.userID = " . WCF::getUser()->userID; } if (!empty($this->sqlSelects)) { $this->sqlSelects .= ','; } $this->sqlSelects .= "like_object.cachedReactions"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_like_object like_object ON like_object.objectTypeID = " . ReactionHandler::getInstance()->getObjectType('com.woltlab.wcf.likeableArticle')->objectTypeID . " AND like_object.objectID = article.articleID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_like_object like_object + ON like_object.objectTypeID = " . ReactionHandler::getInstance()->getObjectType('com.woltlab.wcf.likeableArticle')->objectTypeID . " + AND like_object.objectID = article.articleID"; } /** diff --git a/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php b/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php index 345ddd9540..007b1fa224 100644 --- a/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php +++ b/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php @@ -33,7 +33,9 @@ class AdministrativeAttachmentList extends AttachmentList parent::__construct(); $this->sqlSelects = 'user_table.username'; - $this->sqlJoins = " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = attachment.userID"; + $this->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = attachment.userID"; } /** diff --git a/wcfsetup/install/files/lib/data/media/MediaList.class.php b/wcfsetup/install/files/lib/data/media/MediaList.class.php index e193ee7e80..2b9f9167d9 100644 --- a/wcfsetup/install/files/lib/data/media/MediaList.class.php +++ b/wcfsetup/install/files/lib/data/media/MediaList.class.php @@ -39,7 +39,9 @@ class MediaList extends DatabaseObjectList $searchString = '%' . \addcslashes($searchString, '_%') . '%'; - $this->sqlConditionJoins .= ' LEFT JOIN wcf' . WCF_N . '_media_content media_content ON media_content.mediaID = media.mediaID'; + $this->sqlConditionJoins .= ' + LEFT JOIN wcf' . WCF_N . '_media_content media_content + ON media_content.mediaID = media.mediaID'; $conditionBuilder = new PreparedStatementConditionBuilder(false, 'OR'); $conditionBuilder->add('media_content.title LIKE ?', [$searchString]); diff --git a/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php b/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php index aff03d87ee..cdbef0c789 100644 --- a/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php +++ b/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php @@ -40,6 +40,9 @@ class ViewableMediaList extends MediaList // fetch content data $this->sqlSelects .= "media_content.*, COALESCE(media.languageID, " . $languageID . ") AS localizedLanguageID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_media_content media_content ON media_content.mediaID = media.mediaID AND media_content.languageID = COALESCE(media.languageID, " . $languageID . ")"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_media_content media_content + ON media_content.mediaID = media.mediaID + AND media_content.languageID = COALESCE(media.languageID, " . $languageID . ")"; } } diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php index 03d85e0a39..f58513c36a 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php @@ -45,8 +45,11 @@ class ViewableModerationQueueList extends ModerationQueueList $this->sqlSelects = "moderation_queue.*, assigned_user.username AS assignedUsername, user_table.username"; $this->sqlConditionJoins = ", wcf" . WCF_N . "_moderation_queue moderation_queue"; $this->sqlJoins = ", wcf" . WCF_N . "_moderation_queue moderation_queue"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user assigned_user ON assigned_user.userID = moderation_queue.assignedUserID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = moderation_queue.userID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user assigned_user + ON assigned_user.userID = moderation_queue.assignedUserID + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = moderation_queue.userID"; $this->getConditionBuilder()->add("moderation_queue_to_user.queueID = moderation_queue.queueID"); $this->getConditionBuilder()->add("moderation_queue_to_user.userID = ?", [WCF::getUser()->userID]); $this->getConditionBuilder()->add("moderation_queue_to_user.isAffected = ?", [1]); diff --git a/wcfsetup/install/files/lib/data/template/TemplateList.class.php b/wcfsetup/install/files/lib/data/template/TemplateList.class.php index ddbc984443..37fa7156eb 100644 --- a/wcfsetup/install/files/lib/data/template/TemplateList.class.php +++ b/wcfsetup/install/files/lib/data/template/TemplateList.class.php @@ -34,8 +34,11 @@ class TemplateList extends DatabaseObjectList parent::__construct(); $this->sqlSelects = 'package.package, template_group.templateGroupFolderName'; - $this->sqlJoins = " LEFT JOIN wcf" . WCF_N . "_package package ON package.packageID = template.packageID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_template_group template_group ON template_group.templateGroupID = template.templateGroupID"; + $this->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_package package + ON package.packageID = template.packageID + LEFT JOIN wcf" . WCF_N . "_template_group template_group + ON template_group.templateGroupID = template.templateGroupID"; } /** diff --git a/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php b/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php index 7f15d0139f..27148b2a30 100644 --- a/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php +++ b/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php @@ -85,8 +85,11 @@ class TrophyAction extends AbstractDatabaseObjectAction implements IToggleAction if (!empty($userTrophyList->sqlJoins)) { $userTrophyList->sqlJoins .= ' '; } - $userTrophyList->sqlJoins .= 'LEFT JOIN wcf' . WCF_N . '_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; - $userTrophyList->sqlJoins .= ' LEFT JOIN wcf' . WCF_N . '_category category ON trophy.categoryID = category.categoryID'; + $userTrophyList->sqlJoins .= ' + LEFT JOIN wcf' . WCF_N . '_trophy trophy + ON user_trophy.trophyID = trophy.trophyID + LEFT JOIN wcf' . WCF_N . '_category category + ON trophy.categoryID = category.categoryID'; $userTrophyList->getConditionBuilder()->add('trophy.isDisabled = ?', [0]); $userTrophyList->getConditionBuilder()->add('category.isDisabled = ?', [0]); diff --git a/wcfsetup/install/files/lib/data/user/UserList.class.php b/wcfsetup/install/files/lib/data/user/UserList.class.php index c4592a2286..ea7ee1fcf6 100644 --- a/wcfsetup/install/files/lib/data/user/UserList.class.php +++ b/wcfsetup/install/files/lib/data/user/UserList.class.php @@ -35,6 +35,8 @@ class UserList extends DatabaseObjectList $this->sqlSelects .= ','; } $this->sqlSelects .= "user_option_value.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + ON user_option_value.userID = user_table.userID"; } } diff --git a/wcfsetup/install/files/lib/data/user/UserProfileList.class.php b/wcfsetup/install/files/lib/data/user/UserProfileList.class.php index 142b9af914..e72c5a68d0 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfileList.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfileList.class.php @@ -38,16 +38,22 @@ class UserProfileList extends UserList $this->sqlSelects .= ','; } $this->sqlSelects .= "user_avatar.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + ON user_avatar.avatarID = user_table.avatarID"; if (MODULE_USER_RANK) { $this->sqlSelects .= ",user_rank.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON user_rank.rankID = user_table.rankID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user_rank user_rank + ON user_rank.rankID = user_table.rankID"; } // get current location $this->sqlSelects .= ", session.pageID, session.pageObjectID, session.lastActivityTime AS sessionLastActivityTime"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_session session ON session.userID = user_table.userID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_session session + ON session.userID = user_table.userID"; } /** diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php index cee6bf39ea..f4281c7ecf 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php @@ -50,7 +50,10 @@ class UserFollowerList extends UserFollowList $this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar, user_table.enableGravatar, user_table.gravatarFileExtension"; $this->sqlSelects .= ", user_avatar.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_follow.userID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = user_follow.userID + LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + ON user_avatar.avatarID = user_table.avatarID"; } } diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php index fcd10a67e9..593da80a6f 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php @@ -28,13 +28,19 @@ class UserFollowingList extends UserFollowerList $this->sqlSelects .= "user_avatar.*, user_follow.followID, user_option_value.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_follow.followUserID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = user_follow.followUserID + LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + ON user_option_value.userID = user_table.userID + LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + ON user_avatar.avatarID = user_table.avatarID"; if (MODULE_USER_RANK) { $this->sqlSelects .= ",user_rank.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON user_rank.rankID = user_table.rankID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user_rank user_rank + ON user_rank.rankID = user_table.rankID"; } $this->sqlSelects .= ", user_table.*"; diff --git a/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php b/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php index c69608aae7..f8d3098d8f 100644 --- a/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php +++ b/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php @@ -49,13 +49,19 @@ class ViewableUserIgnoreList extends UserIgnoreList $this->sqlSelects .= ", user_option_value.*"; $this->sqlSelects .= ", user_avatar.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_ignore.ignoreUserID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = user_ignore.ignoreUserID + LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + ON user_option_value.userID = user_table.userID + LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + ON user_avatar.avatarID = user_table.avatarID"; if (MODULE_USER_RANK) { $this->sqlSelects .= ",user_rank.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON user_rank.rankID = user_table.rankID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user_rank user_rank + ON user_rank.rankID = user_table.rankID"; } $this->sqlSelects .= ", user_table.*"; diff --git a/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php b/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php index 0dc913aa71..4eb81cbd43 100644 --- a/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php +++ b/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php @@ -19,7 +19,9 @@ class UserNotificationEventRecipientList extends UserList */ public function __construct() { - $this->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = event_to_user.userID"; + $this->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = event_to_user.userID"; $this->sqlSelects = 'user_table.*'; parent::__construct(); diff --git a/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php b/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php index f825830d41..085ad1d181 100644 --- a/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php +++ b/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php @@ -57,11 +57,18 @@ class UsersOnlineList extends SessionList $this->sqlSelects .= "user_avatar.*, user_option_value.*, user_group.userOnlineMarking, user_table.*"; - $this->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = session.userID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = session.userID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_group user_group ON user_group.groupID = user_table.userOnlineGroupID"; + $this->sqlConditionJoins .= " + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = session.userID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = session.userID + LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + ON user_option_value.userID = user_table.userID + LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + ON user_avatar.avatarID = user_table.avatarID + LEFT JOIN wcf" . WCF_N . "_user_group user_group + ON user_group.groupID = user_table.userOnlineGroupID"; $this->getConditionBuilder()->add('session.lastActivityTime > ?', [TIME_NOW - USER_ONLINE_TIMEOUT]); } diff --git a/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php b/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php index 603ff3779d..01aea116a0 100644 --- a/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php +++ b/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php @@ -46,7 +46,10 @@ class UserProfileVisitorList extends DatabaseObjectList $this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar, user_table.enableGravatar, user_table.gravatarFileExtension"; $this->sqlSelects .= ", user_avatar.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_profile_visitor.userID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; + $this->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = user_profile_visitor.userID + LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + ON user_avatar.avatarID = user_table.avatarID"; } } diff --git a/wcfsetup/install/files/lib/data/user/trophy/UserTrophyAction.class.php b/wcfsetup/install/files/lib/data/user/trophy/UserTrophyAction.class.php index a5f6f20862..6f03ef1761 100644 --- a/wcfsetup/install/files/lib/data/user/trophy/UserTrophyAction.class.php +++ b/wcfsetup/install/files/lib/data/user/trophy/UserTrophyAction.class.php @@ -217,12 +217,20 @@ class UserTrophyAction extends AbstractDatabaseObjectAction if (!empty($userTrophyList->sqlConditionJoins)) { $userTrophyList->sqlConditionJoins .= ' '; } - $userTrophyList->sqlJoins .= 'LEFT JOIN wcf' . WCF_N . '_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; - $userTrophyList->sqlConditionJoins .= 'LEFT JOIN wcf' . WCF_N . '_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; + $userTrophyList->sqlJoins .= ' + LEFT JOIN wcf' . WCF_N . '_trophy trophy + ON user_trophy.trophyID = trophy.trophyID'; + $userTrophyList->sqlConditionJoins .= ' + LEFT JOIN wcf' . WCF_N . '_trophy trophy + ON user_trophy.trophyID = trophy.trophyID'; // trophy category join - $userTrophyList->sqlJoins .= ' LEFT JOIN wcf' . WCF_N . '_category category ON trophy.categoryID = category.categoryID'; - $userTrophyList->sqlConditionJoins .= ' LEFT JOIN wcf' . WCF_N . '_category category ON trophy.categoryID = category.categoryID'; + $userTrophyList->sqlJoins .= ' + LEFT JOIN wcf' . WCF_N . '_category category + ON trophy.categoryID = category.categoryID'; + $userTrophyList->sqlConditionJoins .= ' + LEFT JOIN wcf' . WCF_N . '_category category + ON trophy.categoryID = category.categoryID'; $userTrophyList->getConditionBuilder()->add('trophy.isDisabled = ?', [0]); $userTrophyList->getConditionBuilder()->add('category.isDisabled = ?', [0]); diff --git a/wcfsetup/install/files/lib/data/user/trophy/UserTrophyList.class.php b/wcfsetup/install/files/lib/data/user/trophy/UserTrophyList.class.php index 99149f090a..04e0722f81 100644 --- a/wcfsetup/install/files/lib/data/user/trophy/UserTrophyList.class.php +++ b/wcfsetup/install/files/lib/data/user/trophy/UserTrophyList.class.php @@ -43,12 +43,20 @@ class UserTrophyList extends DatabaseObjectList if (!empty($trophyList->sqlConditionJoins)) { $trophyList->sqlConditionJoins .= ' '; } - $trophyList->sqlJoins .= 'LEFT JOIN wcf' . WCF_N . '_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; - $trophyList->sqlConditionJoins .= 'LEFT JOIN wcf' . WCF_N . '_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; + $trophyList->sqlJoins .= ' + LEFT JOIN wcf' . WCF_N . '_trophy trophy + ON user_trophy.trophyID = trophy.trophyID'; + $trophyList->sqlConditionJoins .= ' + LEFT JOIN wcf' . WCF_N . '_trophy trophy + ON user_trophy.trophyID = trophy.trophyID'; // trophy category join - $trophyList->sqlJoins .= ' LEFT JOIN wcf' . WCF_N . '_category category ON trophy.categoryID = category.categoryID'; - $trophyList->sqlConditionJoins .= ' LEFT JOIN wcf' . WCF_N . '_category category ON trophy.categoryID = category.categoryID'; + $trophyList->sqlJoins .= ' + LEFT JOIN wcf' . WCF_N . '_category category + ON trophy.categoryID = category.categoryID'; + $trophyList->sqlConditionJoins .= ' + LEFT JOIN wcf' . WCF_N . '_category category + ON trophy.categoryID = category.categoryID'; $trophyList->getConditionBuilder()->add('trophy.isDisabled = ?', [0]); $trophyList->getConditionBuilder()->add('category.isDisabled = ?', [0]); diff --git a/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php b/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php index bf9acf27f1..3659237736 100644 --- a/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php +++ b/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php @@ -59,7 +59,11 @@ class UnreadArticleListPage extends ArticleListPage ); if (WCF::getUser()->userID) { - $this->objectList->sqlConditionJoins = "LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID; + $this->objectList->sqlConditionJoins = " + LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit + ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " + AND tracked_visit.objectID = article.articleID + AND tracked_visit.userID = " . WCF::getUser()->userID; $this->objectList->getConditionBuilder()->add("(article.time > tracked_visit.visitTime OR tracked_visit.visitTime IS NULL)"); } } diff --git a/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php b/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php index 202433d3e3..a2f6799133 100644 --- a/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php @@ -30,8 +30,11 @@ class ArticleCommentListBoxController extends AbstractCommentListBoxController { $accessibleCategoryIDs = ArticleCategory::getAccessibleCategoryIDs(); if (!empty($accessibleCategoryIDs)) { - $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_article_content article_content ON article_content.articleContentID = comment.objectID'; - $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_article article ON article.articleID = article_content.articleID'; + $commentList->sqlJoins .= ' + INNER JOIN wcf' . WCF_N . '_article_content article_content + ON article_content.articleContentID = comment.objectID + INNER JOIN wcf' . WCF_N . '_article article + ON article.articleID = article_content.articleID'; $commentList->sqlSelects = 'article_content.title'; $commentList->getConditionBuilder()->add('article.categoryID IN (?)', [$accessibleCategoryIDs]); diff --git a/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php b/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php index e0d37466fe..30e921f2ad 100644 --- a/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php @@ -33,7 +33,9 @@ class ProfileCommentListBoxController extends AbstractCommentListBoxController if (WCF::getSession()->getPermission('user.profile.canViewUserProfile')) { $optionID = User::getUserOptionID('canViewProfile'); - $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_user_option_value user_option_value ON user_option_value.userID = comment.objectID'; + $commentList->sqlJoins .= ' + INNER JOIN wcf' . WCF_N . '_user_option_value user_option_value + ON user_option_value.userID = comment.objectID'; if (WCF::getUser()->userID) { $followers = UserProfileHandler::getInstance()->getFollowers(); diff --git a/wcfsetup/install/files/lib/system/box/UserTrophyListBoxController.class.php b/wcfsetup/install/files/lib/system/box/UserTrophyListBoxController.class.php index bb423c869f..5e73c64a24 100644 --- a/wcfsetup/install/files/lib/system/box/UserTrophyListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/UserTrophyListBoxController.class.php @@ -76,12 +76,20 @@ class UserTrophyListBoxController extends AbstractDatabaseObjectListBoxControlle if (!empty($list->sqlConditionJoins)) { $list->sqlConditionJoins .= ' '; } - $list->sqlJoins .= 'LEFT JOIN wcf' . WCF_N . '_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; - $list->sqlConditionJoins .= 'LEFT JOIN wcf' . WCF_N . '_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; + $list->sqlJoins .= ' + LEFT JOIN wcf' . WCF_N . '_trophy trophy + ON user_trophy.trophyID = trophy.trophyID'; + $list->sqlConditionJoins .= ' + LEFT JOIN wcf' . WCF_N . '_trophy trophy + ON user_trophy.trophyID = trophy.trophyID'; // trophy category join - $list->sqlJoins .= ' LEFT JOIN wcf' . WCF_N . '_category category ON trophy.categoryID = category.categoryID'; - $list->sqlConditionJoins .= ' LEFT JOIN wcf' . WCF_N . '_category category ON trophy.categoryID = category.categoryID'; + $list->sqlJoins .= ' + LEFT JOIN wcf' . WCF_N . '_category category + ON trophy.categoryID = category.categoryID'; + $list->sqlConditionJoins .= ' + LEFT JOIN wcf' . WCF_N . '_category category + ON trophy.categoryID = category.categoryID'; $list->getConditionBuilder()->add('trophy.isDisabled = ?', [0]); $list->getConditionBuilder()->add('category.isDisabled = ?', [0]); diff --git a/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php index b1997855fd..ffad869ebb 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php @@ -21,7 +21,9 @@ class CategoryCacheBuilder extends AbstractCacheBuilder { $list = new CategoryList(); $list->sqlSelects = "object_type.objectType"; - $list->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_object_type object_type ON object_type.objectTypeID = category.objectTypeID"; + $list->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_object_type object_type + ON object_type.objectTypeID = category.objectTypeID"; $list->sqlOrderBy = "category.showOrder ASC"; $list->readObjects(); diff --git a/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php b/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php index 393cad4710..00a7ce9098 100644 --- a/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php +++ b/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php @@ -67,8 +67,11 @@ class TrophyCategoryType extends AbstractCategoryType if (!empty($userTrophyList->sqlJoins)) { $userTrophyList->sqlJoins .= ' '; } - $userTrophyList->sqlJoins .= 'LEFT JOIN wcf' . WCF_N . '_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; - $userTrophyList->sqlJoins .= ' LEFT JOIN wcf' . WCF_N . '_category category ON trophy.categoryID = category.categoryID'; + $userTrophyList->sqlJoins .= ' + LEFT JOIN wcf' . WCF_N . '_trophy trophy + ON user_trophy.trophyID = trophy.trophyID + LEFT JOIN wcf' . WCF_N . '_category category + ON trophy.categoryID = category.categoryID'; $userTrophyList->getConditionBuilder()->add('trophy.isDisabled = ?', [0]); $userTrophyList->getConditionBuilder()->add('category.isDisabled = ?', [0]); diff --git a/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php index 2762604686..115cbbd6e2 100644 --- a/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php @@ -48,7 +48,9 @@ class ExpiringPaidSubscriptionUserCronjob extends AbstractCronjob ); $paidSubscriptionUserList = new PaidSubscriptionUserList(); - $paidSubscriptionUserList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_user.subscriptionID"; + $paidSubscriptionUserList->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription + ON paid_subscription.subscriptionID = paid_subscription_user.subscriptionID"; $paidSubscriptionUserList->getConditionBuilder()->add('paid_subscription_user.endDate <> ?', [0]); $paidSubscriptionUserList->getConditionBuilder()->add( '(' . $conditionBuilder . ')', diff --git a/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php b/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php index 1ca992806d..740d7f0c51 100644 --- a/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php +++ b/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php @@ -112,7 +112,10 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction $sql = "SELECT import_mapping.newID FROM wcf" . WCF_N . "_import_mapping import_mapping - " . ($tableName ? "LEFT JOIN " . $tableName . " object_table ON object_table." . $indexName . " = import_mapping.newID" : '') . " + " . ($tableName ? " + LEFT JOIN " . $tableName . " object_table + ON object_table." . $indexName . " = import_mapping.newID + " : '') . " WHERE import_mapping.importHash = ? AND import_mapping.objectTypeID = ? AND import_mapping.oldID = ? diff --git a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php index d8aadddb25..0c0e634027 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php @@ -307,7 +307,10 @@ class ModerationQueueManager extends SingletonFactory protected function forceUserAssignment() { $queueList = new ModerationQueueList(); - $queueList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user ON moderation_queue_to_user.queueID = moderation_queue.queueID AND moderation_queue_to_user.userID = " . WCF::getUser()->userID; + $queueList->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user + ON moderation_queue_to_user.queueID = moderation_queue.queueID + AND moderation_queue_to_user.userID = " . WCF::getUser()->userID; $queueList->getConditionBuilder()->add("moderation_queue_to_user.queueID IS NULL"); $queueList->readObjects(); diff --git a/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php index eac7518475..f42eb9524c 100644 --- a/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php @@ -50,7 +50,9 @@ class TrophyPageHandler extends AbstractLookupPageHandler if (!empty($trophyList->sqlJoins)) { $trophyList->sqlJoins .= ', '; } - $trophyList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_language_item language_item ON language_item.languageItem = trophy.title"; + $trophyList->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_language_item language_item + ON language_item.languageItem = trophy.title"; $trophyList->getConditionBuilder()->add( '(trophy.title LIKE ? OR language_item.languageItemValue LIKE ?)', ['%' . $searchString . '%', '%' . $searchString . '%'] diff --git a/wcfsetup/install/files/lib/system/poll/PollManager.class.php b/wcfsetup/install/files/lib/system/poll/PollManager.class.php index 6efe7b8f0e..fa3de5c3d4 100644 --- a/wcfsetup/install/files/lib/system/poll/PollManager.class.php +++ b/wcfsetup/install/files/lib/system/poll/PollManager.class.php @@ -431,7 +431,10 @@ class PollManager extends SingletonFactory // check for user votes if (WCF::getUser()->userID) { $optionList->sqlSelects = "CASE WHEN poll_option_vote.optionID IS NULL THEN '0' ELSE '1' END AS voted"; - $optionList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_poll_option_vote poll_option_vote ON poll_option_vote.optionID = poll_option.optionID AND poll_option_vote.userID = " . WCF::getUser()->userID; + $optionList->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_poll_option_vote poll_option_vote + ON poll_option_vote.optionID = poll_option.optionID + AND poll_option_vote.userID = " . WCF::getUser()->userID; } else { $optionList->sqlSelects = "'0' AS voted"; } diff --git a/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php b/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php index 969317ce29..f3899dd120 100644 --- a/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php +++ b/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php @@ -134,7 +134,9 @@ class ArticleSearch extends AbstractSearchableObjectType */ public function getJoins() { - return 'INNER JOIN wcf' . WCF_N . '_article ON wcf' . WCF_N . '_article.articleID = ' . $this->getTableName() . '.articleID'; + return ' + INNER JOIN wcf' . WCF_N . '_article + ON wcf' . WCF_N . '_article.articleID = ' . $this->getTableName() . '.articleID'; } /** diff --git a/wcfsetup/install/files/lib/system/search/PageSearch.class.php b/wcfsetup/install/files/lib/system/search/PageSearch.class.php index bb7d8f2902..2558f6e19c 100644 --- a/wcfsetup/install/files/lib/system/search/PageSearch.class.php +++ b/wcfsetup/install/files/lib/system/search/PageSearch.class.php @@ -142,7 +142,9 @@ class PageSearch extends AbstractSearchableObjectType */ public function getJoins() { - return 'INNER JOIN wcf' . WCF_N . '_page ON wcf' . WCF_N . '_page.pageID = ' . $this->getTableName() . '.pageID'; + return ' + INNER JOIN wcf' . WCF_N . '_page + ON wcf' . WCF_N . '_page.pageID = ' . $this->getTableName() . '.pageID'; } /** diff --git a/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php b/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php index faae58838c..179a06fe46 100644 --- a/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php +++ b/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php @@ -38,8 +38,12 @@ class MultilingualPageSitemapObject extends AbstractSitemapObjectObjectType /** @var $pageList PageContentList */ $pageList = parent::getObjectList(); - $pageList->sqlConditionJoins = 'LEFT JOIN wcf' . WCF_N . '_page page ON page_content.pageID = page.pageID'; - $pageList->sqlJoins = 'LEFT JOIN wcf' . WCF_N . '_page page ON page_content.pageID = page.pageID'; + $pageList->sqlConditionJoins = ' + LEFT JOIN wcf' . WCF_N . '_page page + ON page_content.pageID = page.pageID'; + $pageList->sqlJoins = ' + LEFT JOIN wcf' . WCF_N . '_page page + ON page_content.pageID = page.pageID'; $pageList->getConditionBuilder()->add('page.isMultilingual = ?', [1]); $pageList->getConditionBuilder()->add('page.allowSpidersToIndex = ?', [1]); diff --git a/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php b/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php index 3413527567..0b403695db 100644 --- a/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php +++ b/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php @@ -133,7 +133,9 @@ class TrophyConditionHandler extends SingletonFactory private function getUserIDs(Trophy $trophy) { $userList = new UserList(); - $userList->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; + $userList->sqlConditionJoins .= " + LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + ON user_option_value.userID = user_table.userID"; $conditions = $trophy->getConditions(); foreach ($conditions as $condition) { @@ -196,7 +198,9 @@ class TrophyConditionHandler extends SingletonFactory $userList->sqlJoins = $pseudoUserList->sqlJoins; // We joining the user_trophy table to receive the userTrophyID, which should be deleted. - $userList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_trophy user_trophy ON user_table.userID = user_trophy.userID"; + $userList->sqlJoins .= " + LEFT JOIN wcf" . WCF_N . "_user_trophy user_trophy + ON user_table.userID = user_trophy.userID"; // We do not need the complete user object, but only the userTrophyID. // So that the UserList object can also assign the users (which is used diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index c93d4aee57..ea1b517482 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -47,7 +47,9 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker parent::initObjectList(); $this->objectList->sqlSelects = 'user_option_value.userOption' . User::getUserOptionID('aboutMe') . ' AS aboutMe'; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; + $this->objectList->sqlJoins = " + LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + ON user_option_value.userID = user_table.userID"; $this->objectList->sqlOrderBy = 'user_table.userID'; } -- 2.20.1