Skip to content

Firefly III: a personal finances manager

Fix back and forth between v1 and v2

James Colea4f7c90e098b
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
}