From c16a8c7ab200efa78e9876fb81fcef4b596b73ac Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 23 Mar 2019 07:15:40 -0700 Subject: [PATCH] Fix a content join condition in Phriction After the cursor changes, we may fatal on pages with a large number of children because "c.title" is not a selected column. We currently join the "content" table if "updated" is part of the order vector, but not if "title" is part of the order vector. This isn't right: "updated" is on the primary table, and only "content" is on the joined table. --- src/applications/phriction/query/PhrictionDocumentQuery.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/applications/phriction/query/PhrictionDocumentQuery.php b/src/applications/phriction/query/PhrictionDocumentQuery.php index f05d67c4f3..702d936a2c 100644 --- a/src/applications/phriction/query/PhrictionDocumentQuery.php +++ b/src/applications/phriction/query/PhrictionDocumentQuery.php @@ -193,7 +193,11 @@ final class PhrictionDocumentQuery } private function shouldJoinContentTable() { - return $this->getOrderVector()->containsKey('updated'); + if ($this->getOrderVector()->containsKey('title')) { + return true; + } + + return false; } protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {