diff --git a/src/applications/transactions/controller/PhabricatorEditEngineController.php b/src/applications/transactions/controller/PhabricatorEditEngineController.php index e7306c7866..9c712f7e3a 100644 --- a/src/applications/transactions/controller/PhabricatorEditEngineController.php +++ b/src/applications/transactions/controller/PhabricatorEditEngineController.php @@ -70,13 +70,6 @@ abstract class PhabricatorEditEngineController ->executeOne(); if ($config) { $engine = $config->getEngine(); - - // TODO: When we're editing the meta-engine, we need to set the engine - // itself as its own target. This is hacky and it would be nice to find - // a cleaner approach later. - if ($engine instanceof PhabricatorEditEngineConfigurationEditEngine) { - $engine->setTargetEngine($engine); - } } return $config; diff --git a/src/applications/transactions/editor/PhabricatorEditEngineConfigurationEditEngine.php b/src/applications/transactions/editor/PhabricatorEditEngineConfigurationEditEngine.php index de667ace4e..0c1c4787db 100644 --- a/src/applications/transactions/editor/PhabricatorEditEngineConfigurationEditEngine.php +++ b/src/applications/transactions/editor/PhabricatorEditEngineConfigurationEditEngine.php @@ -14,7 +14,8 @@ final class PhabricatorEditEngineConfigurationEditEngine public function getTargetEngine() { if (!$this->targetEngine) { - throw new PhutilInvalidStateException('setTargetEngine'); + // If we don't have a target engine, assume we're editing ourselves. + return new PhabricatorEditEngineConfigurationEditEngine(); } return $this->targetEngine; }