X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Ffront%2Fcontroller%2Fadmin%2FConfigureController.php;h=e675fccabad0eacf408acc0901c113d0e777a5c9;hb=1a68ae5a29bc33ab80c9cfbe043cb1213551533c;hp=44971c43f2ba1453dd9f61c78055d592084e0fcd;hpb=9c75f877935fa6adec951a4d8d32b328aaab314f;p=github%2Fshaarli%2FShaarli.git
diff --git a/application/front/controller/admin/ConfigureController.php b/application/front/controller/admin/ConfigureController.php
index 44971c43..e675fcca 100644
--- a/application/front/controller/admin/ConfigureController.php
+++ b/application/front/controller/admin/ConfigureController.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Shaarli\Front\Controller\Admin;
use Shaarli\Languages;
+use Shaarli\Render\TemplatePage;
use Shaarli\Render\ThemeUtils;
use Shaarli\Thumbnailer;
use Slim\Http\Request;
@@ -52,7 +53,7 @@ class ConfigureController extends ShaarliAdminController
$this->assignView('thumbnails_mode', $this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE));
$this->assignView('pagetitle', t('Configure') .' - '. $this->container->conf->get('general.title', 'Shaarli'));
- return $response->write($this->render('configure'));
+ return $response->write($this->render(TemplatePage::CONFIGURE));
}
/**
@@ -97,10 +98,10 @@ class ConfigureController extends ShaarliAdminController
if ($thumbnailsMode !== Thumbnailer::MODE_NONE
&& $thumbnailsMode !== $this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE)
) {
- $this->saveWarningMessage(t(
- 'You have enabled or changed thumbnails mode. '
- .'Please synchronize them.'
- ));
+ $this->saveWarningMessage(
+ t('You have enabled or changed thumbnails mode.') .
+ '' . t('Please synchronize them.') .''
+ );
}
$this->container->conf->set('thumbnails.mode', $thumbnailsMode);
@@ -109,8 +110,13 @@ class ConfigureController extends ShaarliAdminController
$this->container->history->updateSettings();
$this->container->pageCacheManager->invalidateCaches();
} catch (Throwable $e) {
- // TODO: translation + stacktrace
- $this->saveErrorMessage('ERROR while writing config file after configuration update.');
+ $this->assignView('message', t('Error while writing config file after configuration update.'));
+
+ if ($this->container->conf->get('dev.debug', false)) {
+ $this->assignView('stacktrace', $e->getMessage() . PHP_EOL . $e->getTraceAsString());
+ }
+
+ return $response->write($this->render('error'));
}
$this->saveSuccessMessage(t('Configuration was saved.'));