From 186a12ef7f2a82d0dc89dfd902ca262154a7d09c Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 29 Apr 2020 14:41:28 -0700 Subject: [PATCH] Replace nonexistent "withPHIDs()" in ChangesetQuery with "withIDs()" Summary: Ref T13519. See . Changesets do not have PHIDs, and the Query has no "withPHIDs()" method. The keys in the viewstate storage are (usually) IDs. Test Plan: - On a revision with Diff 1 and Diff 2 affecting the same file: - Viewed Diff 1. - Hid file A. - Viewed Diff 2. - Before patch: exception about call to "withPHIDs()", which does not exist for ChangesetQuery. - After patch: no exception. Also, file actually unhid, which is the correct behavior! Maniphest Tasks: T13519 Differential Revision: https://secure.phabricator.com/D21189 --- .../diff/viewstate/PhabricatorChangesetViewStateEngine.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/infrastructure/diff/viewstate/PhabricatorChangesetViewStateEngine.php b/src/infrastructure/diff/viewstate/PhabricatorChangesetViewStateEngine.php index a506ec38dc..2363f7f0ff 100644 --- a/src/infrastructure/diff/viewstate/PhabricatorChangesetViewStateEngine.php +++ b/src/infrastructure/diff/viewstate/PhabricatorChangesetViewStateEngine.php @@ -197,7 +197,7 @@ final class PhabricatorChangesetViewStateEngine $entries = isort($entries, 'epoch'); if ($entries) { - $other_phid = last_key($entries); + $other_key = last_key($entries); $other_spec = last($entries); $this_version = (int)$changeset->getDiffID(); @@ -213,7 +213,7 @@ final class PhabricatorChangesetViewStateEngine $other_changeset = id(new DifferentialChangesetQuery()) ->setViewer($viewer) - ->withPHIDs(array($other_phid)) + ->withIDs(array($other_key)) ->executeOne(); $is_modified = false;