From 46ceba728fee8a775e2ddf0cdae332a0679413a4 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 9 Jul 2016 05:55:45 -0700 Subject: [PATCH] (stable) Fix an issue with creating new Repository URIs via the Web UI Summary I broke this in D16237: that made the CLI workflow work, but we attach the repository earlier in the web workflow and won't have one when we arrive here. Test Plan: Created a new repository URI from the web UI. Auditors: chad --- .../diffusion/editor/DiffusionURIEditor.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/applications/diffusion/editor/DiffusionURIEditor.php b/src/applications/diffusion/editor/DiffusionURIEditor.php index 2ff0854a89..0b7096db3c 100644 --- a/src/applications/diffusion/editor/DiffusionURIEditor.php +++ b/src/applications/diffusion/editor/DiffusionURIEditor.php @@ -78,10 +78,12 @@ final class DiffusionURIEditor } 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); + // When creating a URI via the API, we may not have processed the + // repository transaction yet. Attach the repository here to make + // sure we have it for the calls below. + if ($this->repository) { + $object->attachRepository($this->repository); + } } $object->setURI($xaction->getNewValue());