Clean up an issue with meta-editing of edit engines
Summary: Ref T9908. These meta-edit-engines are used to generate the main editengine UIs, but they're also editable. Fix an exception when trying to edit the meta editengine. Test Plan: Edited editengineconfiguration editengine. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9908 Differential Revision: https://secure.phabricator.com/D14783
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user