Fix fetching userID for multilanguage articles
authorjoshuaruesweg <ruesweg@woltlab.com>
Tue, 19 Apr 2022 08:18:31 +0000 (10:18 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Tue, 19 Apr 2022 08:18:31 +0000 (10:18 +0200)
wcfsetup/install/files/lib/system/user/notification/object/type/ArticleCommentUserNotificationObjectType.class.php

index 84c83069b64880bce00e9293b4b13f836f0ec850..6ef8a07c4f8acfa9a6167fb34bb2fecbaac246e4 100644 (file)
@@ -40,11 +40,13 @@ class ArticleCommentUserNotificationObjectType extends AbstractUserNotificationO
     public function getOwnerID($objectID)
     {
         $sql = "SELECT      article.userID
-                FROM        wcf" . WCF_N . "_comment comment
-                LEFT JOIN   wcf" . WCF_N . "_article article
-                ON          article.articleID = comment.objectID
+                FROM        wcf1_comment comment
+                INNER JOIN  wcf1_article_content article_content
+                ON          article_content.articleContentID = comment.objectID
+                INNER JOIN  wcf1_article article
+                ON          article_content.articleID = article.articleID
                 WHERE       comment.commentID = ?";
-        $statement = WCF::getDB()->prepareStatement($sql);
+        $statement = WCF::getDB()->prepare($sql);
         $statement->execute([$objectID]);
 
         return $statement->fetchSingleColumn() ?: 0;