From 75c359835903b8d083c8e2c783469c1dfdfa11ea Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 24 Jun 2019 09:23:25 -0700 Subject: [PATCH] Require commit identities when editing commits to resolve an issue with audit actions not applying properly Summary: See . In D20581, I made some audit behavior dependent upon identities, but the actual edit flow doesn't load them. This can cause us to raise an "attach identities first" exception in the bowels of the edit workflow and trigger unexpected behavior at top level. Load identities when editing a commit so that the transaction flows have access to identity information and can use it to figure out if a user is an author, etc. Test Plan: - As an auditor, applied an "Accept Commit" action to an open audit after D20581. - Before patch: accept no-ops internally since the preconditions throw. - After patch: accept works properly. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D20612 --- .../diffusion/editor/DiffusionCommitEditEngine.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/applications/diffusion/editor/DiffusionCommitEditEngine.php b/src/applications/diffusion/editor/DiffusionCommitEditEngine.php index 5b7277000f..6e45241d68 100644 --- a/src/applications/diffusion/editor/DiffusionCommitEditEngine.php +++ b/src/applications/diffusion/editor/DiffusionCommitEditEngine.php @@ -48,7 +48,8 @@ final class DiffusionCommitEditEngine return id(new DiffusionCommitQuery()) ->needCommitData(true) ->needAuditRequests(true) - ->needAuditAuthority(array($viewer)); + ->needAuditAuthority(array($viewer)) + ->needIdentities(true); } protected function getEditorURI() {