From 10cc5f266066d7e8e8f10a170a65f33c575dd672 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 2 Dec 2011 14:24:44 -0800 Subject: [PATCH] Set user on auxiliary fields before validating them on template workflow Summary: Some fields need this data in some circumstances in order to validate -- see D1153. Test Plan: Ran "arc diff" against local, no longer got an exception for access of this field from the 'Reviewers' validator. Reviewers: btrahan Reviewed By: btrahan CC: aran, btrahan Differential Revision: 1160 --- .../editor/revision/DifferentialRevisionEditor.php | 5 +++++ src/applications/differential/editor/revision/__init__.php | 1 + 2 files changed, 6 insertions(+) diff --git a/src/applications/differential/editor/revision/DifferentialRevisionEditor.php b/src/applications/differential/editor/revision/DifferentialRevisionEditor.php index d0c2153ec8..1a687f3287 100644 --- a/src/applications/differential/editor/revision/DifferentialRevisionEditor.php +++ b/src/applications/differential/editor/revision/DifferentialRevisionEditor.php @@ -69,8 +69,13 @@ class DifferentialRevisionEditor { $aux_fields = DifferentialFieldSelector::newSelector() ->getFieldSpecifications(); + $user = id(new PhabricatorUser())->loadOneWhere( + 'phid = %s', + $this->actorPHID); + foreach ($aux_fields as $key => $aux_field) { $aux_field->setRevision($revision); + $aux_field->setUser($user); if (!$aux_field->shouldAppearOnCommitMessage()) { unset($aux_fields[$key]); } diff --git a/src/applications/differential/editor/revision/__init__.php b/src/applications/differential/editor/revision/__init__.php index 47e3de505e..6501371f08 100644 --- a/src/applications/differential/editor/revision/__init__.php +++ b/src/applications/differential/editor/revision/__init__.php @@ -24,6 +24,7 @@ phutil_require_module('phabricator', 'applications/feed/publisher'); phutil_require_module('phabricator', 'applications/herald/adapter/differential'); phutil_require_module('phabricator', 'applications/herald/engine/engine'); phutil_require_module('phabricator', 'applications/herald/storage/transcript/base'); +phutil_require_module('phabricator', 'applications/people/storage/user'); phutil_require_module('phabricator', 'applications/phid/handle/data'); phutil_require_module('phabricator', 'applications/search/index/indexer/differential'); phutil_require_module('phabricator', 'infrastructure/daemon/timeline/storage/event');