Merge pull request #21044 from nextcloud/enhancement/app-disable-log-message

Add a message to the log entry of an app being disabled
This commit is contained in:
Morris Jobke 2020-05-19 14:47:13 +02:00 committed by GitHub
commit 7a22039ce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -157,11 +157,17 @@ class OC_App {
if ($ex instanceof ServerNotAvailableException) {
throw $ex;
}
\OC::$server->getLogger()->logException($ex);
if (!\OC::$server->getAppManager()->isShipped($app) && !self::isType($app, ['authentication'])) {
\OC::$server->getLogger()->logException($ex, [
'message' => "App $app threw an error during app.php load and will be disabled: " . $ex->getMessage(),
]);
// Only disable apps which are not shipped and that are not authentication apps
\OC::$server->getAppManager()->disableApp($app, true);
} else {
\OC::$server->getLogger()->logException($ex, [
'message' => "App $app threw an error during app.php load: " . $ex->getMessage(),
]);
}
}
\OC::$server->getEventLogger()->end('load_app_' . $app);