diff --git a/core/Command/App/Enable.php b/core/Command/App/Enable.php index c4e2363def5606cdb11fb4c128c0b281f0b589a9..d82a71d9eb4bbaeadf511f3f7733b32c30f6f214 100644 --- a/core/Command/App/Enable.php +++ b/core/Command/App/Enable.php @@ -105,6 +105,10 @@ class Enable extends Command implements CompletionAwareInterface { return $group->getDisplayName(); }, $groupIds); + if ($this->appManager->isInstalled($appId) && $groupIds === []) { + $output->writeln($appId . ' already enabled'); + return; + } try { /** @var Installer $installer */ diff --git a/tests/Core/Command/Apps/AppsEnableTest.php b/tests/Core/Command/Apps/AppsEnableTest.php index a8aa4c434f0b76282080a4f476a7bc2dffaef2d0..b5d781aa125c9a2b1a0f34d50884f0d5463c7db0 100644 --- a/tests/Core/Command/Apps/AppsEnableTest.php +++ b/tests/Core/Command/Apps/AppsEnableTest.php @@ -75,6 +75,7 @@ class AppsEnableTest extends TestCase { $data = [ [['admin_audit'], null, 0, 'admin_audit enabled'], [['comments'], null, 0, 'comments enabled'], + [['comments', 'comments'], null, 0, "comments enabled\ncomments already enabled"], [['invalid_app'], null, 1, 'Could not download app invalid_app'], [['admin_audit', 'comments'], null, 0, "admin_audit enabled\ncomments enabled"],