From 921d56efb0f0fbbcb975bf1845b094dc32dcd760 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 5 Jul 2016 16:38:05 -0700 Subject: [PATCH] Make repository URI creation work regardless of "repository" transaction order Summary: Fixes T11276. This feels slightly iffy (we `attachRepository()` here, and also when applying the TYPE_REPOSITORY transaction) but simpler than trying to reorder things. Test Plan: Created a repository URI with transactions in `["uri", "repository"]` order. Reviewers: chad, avivey Reviewed By: avivey Maniphest Tasks: T11276 Differential Revision: https://secure.phabricator.com/D16237 --- src/applications/diffusion/editor/DiffusionURIEditor.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/diffusion/editor/DiffusionURIEditor.php b/src/applications/diffusion/editor/DiffusionURIEditor.php index c22b888ac5..2ff0854a89 100644 --- a/src/applications/diffusion/editor/DiffusionURIEditor.php +++ b/src/applications/diffusion/editor/DiffusionURIEditor.php @@ -77,6 +77,11 @@ final class DiffusionURIEditor $old_uri = $object->getEffectiveURI(); } else { $old_uri = null; + + // When creating a URI, we may not have processed the repository + // transaction yet. Attach the repository here to make sure we + // have it for the calls below. + $object->attachRepository($this->repository); } $object->setURI($xaction->getNewValue());