Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix app enable of not existing app #28239

Merged
merged 5 commits into from
Jul 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion core/shipped.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"encryption",
"configreport",
"dav",
"enterprise_key",
"federation",
"federatedfilesharing",
"files",
Expand Down
15 changes: 10 additions & 5 deletions lib/private/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,16 +429,21 @@ public static function isDownloaded( $name ) {
public static function removeApp($appId) {

if(Installer::isDownloaded( $appId )) {
$appDir=OC_App::getInstallPath() . '/' . $appId;
$appDir = OC_App::getAppPath($appId);
if ($appDir === false) {
return false;
}
if(is_dir("$appDir/.git")) {
throw new AppAlreadyInstalledException("App <$appId> is a git clone - it will not be deleted.");
}

OC_Helper::rmdirr($appDir);

return true;
}else{
\OCP\Util::writeLog('core', 'can\'t remove app '.$appId.'. It is not installed.', \OCP\Util::ERROR);

return false;
}
\OCP\Util::writeLog('core', 'can\'t remove app '.$appId.'. It is not installed.', \OCP\Util::ERROR);

return false;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions lib/private/legacy/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ public static function enable($app, $groups = null) {
$config = \OC::$server->getConfig();
$l = \OC::$server->getL10N('core');
$info = self::getAppInfo($app);
if ($info === null) {
throw new \Exception("$app can't be enabled since it is not installed.");
}

self::checkAppDependencies($config, $l, $info);

Expand Down
3 changes: 2 additions & 1 deletion lib/public/App/IAppManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ public function getAlwaysEnabledApps();

/**
* @param string $package
* @param bool $skipMigrations whether to skip migrations, which would only install the code
* @return mixed
* @since 10.0
*/
public function installApp($package);
public function installApp($package, $skipMigrations = false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, need to get rid of this flag separately... it's unused now


/**
* @param string $package
Expand Down