From 9918ea1fb7caa6e8abdbc286eccdc329212f2f75 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 6 Mar 2019 16:22:52 -0800 Subject: [PATCH] Fix an exception with user cache generation in "bin/conduit call --as " Summary: Ref T13249. Using "--as" to call some Conduit methods as a user can currently fatal when trying to access settings/preferences. Allow inline regeneration of user caches. Test Plan: Called `project.edit` to add a member. Before: constructing a policy field tried to access the user's preferences and failed. After: Smooth sailing. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13249 Differential Revision: https://secure.phabricator.com/D20255 --- .../management/PhabricatorConduitCallManagementWorkflow.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/applications/conduit/management/PhabricatorConduitCallManagementWorkflow.php b/src/applications/conduit/management/PhabricatorConduitCallManagementWorkflow.php index f9ba48b372..dc241a04b4 100644 --- a/src/applications/conduit/management/PhabricatorConduitCallManagementWorkflow.php +++ b/src/applications/conduit/management/PhabricatorConduitCallManagementWorkflow.php @@ -58,6 +58,10 @@ final class PhabricatorConduitCallManagementWorkflow 'No such user "%s" exists.', $as)); } + + // Allow inline generation of user caches for the user we're acting + // as, since some calls may read user preferences. + $actor->setAllowInlineCacheGeneration(true); } else { $actor = $viewer; }