From a4f7c90e098b6e5ee936578011788b2bcb283422 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 21:24:50 +0200 Subject: [PATCH] Fix back and forth between v1 and v2 --- app/Console/Commands/Upgrade/UpgradesDatabase.php | 8 +++++++- app/Http/Controllers/Controller.php | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/Upgrade/UpgradesDatabase.php b/app/Console/Commands/Upgrade/UpgradesDatabase.php index d30b32662a..cfe9a8a44c 100644 --- a/app/Console/Commands/Upgrade/UpgradesDatabase.php +++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php @@ -23,8 +23,14 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; +use Illuminate\Support\Facades\Log; +use Safe\Exceptions\InfoException; -\Safe\set_time_limit(0); +try { + set_time_limit(0); +} catch (InfoException) { + Log::warning('set_time_limit returned false. This could be an issue, unless you also run XDebug.'); +} use FireflyIII\Console\Commands\ShowsFriendlyMessages; use Illuminate\Console\Command; diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 2ac0db4408..f7e5922f1a 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -32,6 +32,7 @@ use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; +use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\View; use Route; @@ -80,6 +81,8 @@ abstract class Controller extends BaseController // overrule v2 layout back to v1. if ('true' === request()->get('force_default_layout') && 'v2' === config('view.layout')) { + //config('view.layout','v1'); + Config::set('view.layout', 'v1'); View::getFinder()->setPaths([\Safe\realpath(base_path('resources/views'))]); // @phpstan-ignore-line }