mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Fix #11281 and some other stuff.
This commit is contained in:
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Http\Api;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
@@ -53,7 +54,7 @@ trait CollectsAccountsFromFilter
|
||||
// if no preselected, but no accounts:
|
||||
if ('empty' === $queryParameters['preselected'] && 0 === $collection->count()) {
|
||||
$defaultSet = $this->repository->getAccountsByType([AccountTypeEnum::ASSET->value, AccountTypeEnum::DEFAULT->value])->pluck('id')->toArray();
|
||||
$frontpage = app('preferences')->get('frontpageAccounts', $defaultSet);
|
||||
$frontpage = Preferences::get('frontpageAccounts', $defaultSet);
|
||||
|
||||
if (!(is_array($frontpage->data) && count($frontpage->data) > 0)) {
|
||||
$frontpage->data = $defaultSet;
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Http\Controllers;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\ValidationException;
|
||||
use FireflyIII\Http\Requests\RuleFormRequest;
|
||||
@@ -110,7 +111,7 @@ trait RequestInformation
|
||||
$shownDemo = true;
|
||||
// both must be array and either must be > 0
|
||||
if (count($intro) > 0 || count($specialIntro) > 0) {
|
||||
$shownDemo = app('preferences')->get($key, false)->data;
|
||||
$shownDemo = Preferences::get($key, false)->data;
|
||||
}
|
||||
if (!is_bool($shownDemo)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user