From 825a403f9cf69a50a24837609f616aeb325324d6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 9 Nov 2016 09:18:11 +0100 Subject: [PATCH 1/3] Fix help link Signed-off-by: Joas Schilling --- settings/templates/help.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/settings/templates/help.php b/settings/templates/help.php index 11726d6038..f849ea0f42 100644 --- a/settings/templates/help.php +++ b/settings/templates/help.php @@ -28,9 +28,8 @@
  • - - t('Issue tracker')); ?> ↗ + + t('Getting help')); ?> ↗
  • From ef917ee9c80108dfcb6c98cb2ded41fb7b189924 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 9 Nov 2016 09:10:32 +0100 Subject: [PATCH 2/3] Use a better error message and point the users to the support channels Signed-off-by: Joas Schilling --- lib/private/Installer.php | 10 +++++++++- lib/private/Updater.php | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 009df79058..cb2b841dca 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -40,6 +40,7 @@ namespace OC; +use Doctrine\DBAL\Exception\TableExistsException; use OC\App\CodeChecker\CodeChecker; use OC\App\CodeChecker\EmptyCheck; use OC\App\CodeChecker\PrivateCheck; @@ -561,7 +562,14 @@ class Installer { //install the database $appPath = OC_App::getAppPath($app); if(is_file("$appPath/appinfo/database.xml")) { - OC_DB::createDbFromStructure("$appPath/appinfo/database.xml"); + try { + OC_DB::createDbFromStructure("$appPath/appinfo/database.xml"); + } catch (TableExistsException $e) { + throw new HintException( + 'Failed to enable app ' . $app, + 'Please ask for help via one of our support channels.' + ); + } } //run appinfo/install.php diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 609e965bfa..1864758c85 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -149,6 +149,10 @@ class Updater extends BasicEmitter { $success = true; try { $this->doUpgrade($currentVersion, $installedVersion); + } catch (HintException $exception) { + $this->log->logException($exception, ['app' => 'core']); + $this->emit('\OC\Updater', 'failure', array($exception->getMessage() . ': ' .$exception->getHint())); + $success = false; } catch (\Exception $exception) { $this->log->logException($exception, ['app' => 'core']); $this->emit('\OC\Updater', 'failure', array(get_class($exception) . ': ' .$exception->getMessage())); From 9e2e29aa104a464a4b392e470db5eea932365e47 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 9 Nov 2016 10:29:25 +0100 Subject: [PATCH 3/3] Correctly catch the "soft errors" now Signed-off-by: Joas Schilling --- lib/private/Installer.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/private/Installer.php b/lib/private/Installer.php index cb2b841dca..2a0a6ed4ed 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -533,9 +533,12 @@ class Installer { if ($softErrors) { try { Installer::installShippedApp($filename); - } catch (\Doctrine\DBAL\Exception\TableExistsException $e) { - $errors[$filename] = $e; - continue; + } catch (HintException $e) { + if ($e->getPrevious() instanceof TableExistsException) { + $errors[$filename] = $e; + continue; + } + throw $e; } } else { Installer::installShippedApp($filename); @@ -567,7 +570,8 @@ class Installer { } catch (TableExistsException $e) { throw new HintException( 'Failed to enable app ' . $app, - 'Please ask for help via one of our support channels.' + 'Please ask for help via one of our support channels.', + 0, $e ); } }