From 9c2d05858e9b0431cb9e379a9dbe20038f90444c Mon Sep 17 00:00:00 2001 From: Dave Schatz Date: Mon, 14 Dec 2020 18:13:00 -0800 Subject: [PATCH] Fixed to make this work with Phabricator's new PHIDs --- includes/class.phabricatorexport.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/class.phabricatorexport.php b/includes/class.phabricatorexport.php index 56d94a5..5906de8 100644 --- a/includes/class.phabricatorexport.php +++ b/includes/class.phabricatorexport.php @@ -19,16 +19,15 @@ public function getDocumentIndex() { $query = 'SELECT * FROM phriction_document ORDER BY depth ASC'; $rows = $this->db->query($query); $rows->setFetchMode(PDO::FETCH_ASSOC); - $return = array(); while($row = $rows->fetch()) { - $return[] = $this->getDocument($row['id']); + $return[] = $this->getDocument($row['contentPHID']); } return $return; } - public function getDocument($id) { - $query = sprintf('SELECT * FROM phriction_content WHERE documentID = %d ORDER BY version DESC LIMIT 1', $id); + public function getDocument($phid) { + $query = sprintf('SELECT * FROM phriction_content WHERE phid = "%s" ORDER BY version DESC LIMIT 1', $phid); $row = $this->db->query($query); $row->setFetchMode(PDO::FETCH_CLASS, 'PhrictionDoc'); return $row->fetch();