mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 13:22:42 +01:00
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:
parent
2805ba6f42
commit
81ae9f8fb6
2 changed files with 2 additions and 8 deletions
|
@ -70,13 +70,6 @@ abstract class PhabricatorEditEngineController
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if ($config) {
|
if ($config) {
|
||||||
$engine = $config->getEngine();
|
$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;
|
return $config;
|
||||||
|
|
|
@ -14,7 +14,8 @@ final class PhabricatorEditEngineConfigurationEditEngine
|
||||||
|
|
||||||
public function getTargetEngine() {
|
public function getTargetEngine() {
|
||||||
if (!$this->targetEngine) {
|
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;
|
return $this->targetEngine;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue