diff --git a/app/Http/Controllers/Account/IndexController.php b/app/Http/Controllers/Account/IndexController.php index 181f9fd607..79061b6a99 100644 --- a/app/Http/Controllers/Account/IndexController.php +++ b/app/Http/Controllers/Account/IndexController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Account; use Carbon\Carbon; +use Exception; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -32,7 +33,7 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\View\View; -use Exception; +use Log; /** * @@ -41,8 +42,8 @@ use Exception; class IndexController extends Controller { use BasicDataSupport; - /** @var AccountRepositoryInterface The account repository */ - private $repository; + + private AccountRepositoryInterface $repository; /** * IndexController constructor. @@ -122,32 +123,31 @@ class IndexController extends Controller * @param Request $request * @param string $objectType * - * @throws Exception * @return Factory|View + * @throws Exception */ public function index(Request $request, string $objectType) { - // reset account order: - + Log::debug(sprintf('Now at %s', __METHOD__)); $objectType = $objectType ?? 'asset'; $subTitle = (string) trans(sprintf('firefly.%s_accounts', $objectType)); $subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $objectType)); $types = config(sprintf('firefly.accountTypesByIdentifier.%s', $objectType)); if (1 === random_int(0, 20)) { + Log::debug('Will reset order.'); $this->repository->resetAccountOrder($types); } $collection = $this->repository->getActiveAccountsByType($types); - - - $total = $collection->count(); $page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page'); $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $accounts = $collection->slice(($page - 1) * $pageSize, $pageSize); $inactiveCount = $this->repository->getInactiveAccountsByType($types)->count(); + Log::debug(sprintf('Count of collection: %d, count of accounts: %d', $total, $accounts->count())); + unset($collection); /** @var Carbon $start */ $start = clone session('start', Carbon::now()->startOfMonth()); @@ -174,9 +174,14 @@ class IndexController extends Controller } ); // make paginator: + Log::debug(sprintf('Count of accounts before LAP: %d', $accounts->count())); + /** @var LengthAwarePaginator $accounts */ $accounts = new LengthAwarePaginator($accounts, $total, $pageSize, $page); $accounts->setPath(route('accounts.index', [$objectType])); + Log::debug(sprintf('Count of accounts after LAP (1): %d', $accounts->count())); + Log::debug(sprintf('Count of accounts after LAP (2): %d', $accounts->getCollection()->count())); + return view('accounts.index', compact('objectType', 'inactiveCount', 'subTitleIcon', 'subTitle', 'page', 'accounts')); } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index fe57449a1c..3eb1e8f4e1 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -127,14 +127,6 @@ class LoginController extends Controller */ public function showLoginForm(Request $request) { - $loginProvider = config('firefly.login_provider'); - $authGuard = config('firefly.authentication_guard'); - $route = request()->route()->getName(); - if (('eloquent' !== $loginProvider || 'web' !== $authGuard) && 'logout' !== $route) { - throw new FireflyException('Using external identity provider. Cannot continue.'); - } - - Log::channel('audit')->info('Show login form (1.1).'); $count = DB::table('users')->count(); diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index d6055e4da2..01a64ad9e6 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -142,6 +142,10 @@ class DebugController extends Controller $bcscale = bcscale(); $layout = env('FIREFLY_III_LAYOUT'); + // expected + found DB version: + $expectedDBversion = config('firefly.db_version'); + $foundDBversion = \FireflyConfig::get('db_version',1)->data; + // some new vars. $telemetry = true === config('firefly.send_telemetry') && true === config('firefly.feature_flags.telemetry'); $defaultLanguage = (string) config('firefly.default_language'); @@ -190,6 +194,8 @@ class DebugController extends Controller compact( 'phpVersion', 'localeAttempts', + 'expectedDBversion', + 'foundDBversion', 'appEnv', 'appDebug', 'logChannel', diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 30b28975e1..b5c5d9724b 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -82,6 +82,7 @@ class ProfileController extends Controller $loginProvider = config('firefly.login_provider'); $authGuard = config('firefly.authentication_guard'); $this->externalIdentity = 'eloquent' !== $loginProvider || 'web' !== $authGuard; + Log::debug(sprintf('ProfileController::__construct(). Login provider is "%s", authentication guard is "%s"',$loginProvider, $authGuard)); $this->middleware(IsDemoUser::class)->except(['index']); } @@ -345,7 +346,6 @@ class ProfileController extends Controller $userId = $user->id; $enabled2FA = null !== $user->mfa_secret; $mfaBackupCount = count(app('preferences')->get('mfa_recovery', [])->data); - $this->createOAuthKeys(); if (0 === $count) { diff --git a/changelog.md b/changelog.md index d9ee180890..1a72bf8b2d 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [5.4.1 (API 1.4.0)] - 2020-09-21 + +As usual, a same-day release fixing some exotic bugs. + +### Added +- DB version info. + +### Fixed +- [Issue 3809](https://github.com/firefly-iii/firefly-iii/issues/3809) Issue with LDAP logins fixed. +- [Issue 3816](https://github.com/firefly-iii/firefly-iii/issues/3816) Issue with account lists being empty. + ## [5.4.0 (API 1.4.0)] - 2020-09-21 Some warnings before you install this version: @@ -9,7 +20,7 @@ Some warnings before you install this version: - ⚠️ Some changes in this release may be backwards incompatible (see below). - ⚠️ Invalid triggers in a non-strict rule will cause Firefly III to select ALL transactions. - ⚠️ The `export` volume is no longer used (Docker). -- ⚠️ The `upload` volume is now located at `/var/www/public/storage/upload` (Docker). +- ⚠️ The `upload` volume is now located at `/var/www/html/storage/upload` (Docker). Several alpha and beta releases preceded this release. diff --git a/config/auth.php b/config/auth.php index 1b49d38409..955f2fc96a 100644 --- a/config/auth.php +++ b/config/auth.php @@ -90,7 +90,7 @@ return [ 'providers' => [ 'users' => [ - 'driver' => envNonEmpty('LOGIN_PROVIDER', 'eloquent'), //'adldap', + 'driver' => envNonEmpty('LOGIN_PROVIDER', 'eloquent'), 'model' => FireflyIII\User::class, ], 'remote_user_provider' => [ diff --git a/config/firefly.php b/config/firefly.php index 936943d1db..b48a0a8f13 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -95,7 +95,7 @@ return [ ], //'encryption' => null === env('USE_ENCRYPTION') || true === env('USE_ENCRYPTION'), - 'version' => '5.4.0', + 'version' => '5.4.1', 'api_version' => '1.4.0', 'db_version' => 15, 'maxUploadSize' => 1073741824, // 1 GB diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index 8df62f07eb..d7f2e3fda8 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -908,7 +908,7 @@ return [ 'options' => 'Opties', // budgets: - 'budget_limit_not_in_range' => 'This amount applies from :start to :end:', + 'budget_limit_not_in_range' => 'Dit bedrag is van toepassing op :start tot :end:', 'total_available_budget' => 'Totaal beschikbare budget (tussen :start en :end)', 'total_available_budget_in_currency' => 'Totaal beschikbare budget in :currency', 'see_below' => 'zie onder', diff --git a/resources/views/v1/accounts/delete.twig b/resources/views/v1/accounts/delete.twig index bd366b509b..76b61ae2a3 100644 --- a/resources/views/v1/accounts/delete.twig +++ b/resources/views/v1/accounts/delete.twig @@ -33,7 +33,7 @@ {% endif %}

{% endif %} - {% if account.transactions.count > 0 and account.accountType.type == 'Asset account' %} + {% if account.transactions.count() > 0 and account.accountType.type == 'Asset account' %}

{{ trans_choice('firefly.save_transactions_by_moving', account.transactions|length ) }}

diff --git a/resources/views/v1/accounts/index.twig b/resources/views/v1/accounts/index.twig index b08ae48bce..dd036b55e0 100644 --- a/resources/views/v1/accounts/index.twig +++ b/resources/views/v1/accounts/index.twig @@ -5,7 +5,7 @@ {% endblock %} {% block content %} - {% if accounts.count > 0 %} + {% if accounts.count() > 0 %}
@@ -65,7 +65,7 @@
{% endif %} - {% if accounts.count == 0 and page == 1 %} + {% if accounts.count() == 0 and page == 1 %} {% include 'partials.empty' with {objectType: objectType, type: 'accounts',route: route('accounts.create', [objectType])} %} {% endif %} {% endblock %} diff --git a/resources/views/v1/accounts/show.twig b/resources/views/v1/accounts/show.twig index 944083cfe8..9744a83cdf 100644 --- a/resources/views/v1/accounts/show.twig +++ b/resources/views/v1/accounts/show.twig @@ -7,7 +7,7 @@ {% block content %}
-
+

@@ -32,7 +32,7 @@

- {% if attachments.count > 0 %} + {% if attachments.count() > 0 %}
@@ -115,7 +115,7 @@
{% endif %} - {% if account.notes.count == 1 %} + {% if account.notes.count() == 1 %}
diff --git a/resources/views/v1/bills/delete.twig b/resources/views/v1/bills/delete.twig index b717d8bf37..3f3284af8e 100644 --- a/resources/views/v1/bills/delete.twig +++ b/resources/views/v1/bills/delete.twig @@ -24,8 +24,8 @@

- {% if bill.transactionjournals.count > 0 %} - {{ Lang.choice('form.bill_keep_transactions', bill.transactionjournals.count,{count: bill.transactionjournals.count}) }} + {% if bill.transactionjournals.count() > 0 %} + {{ Lang.choice('form.bill_keep_transactions', bill.transactionjournals.count(),{count: bill.transactionjournals.count()}) }} {% endif %}

diff --git a/resources/views/v1/bills/edit.twig b/resources/views/v1/bills/edit.twig index d916d702a4..f55a38dc95 100644 --- a/resources/views/v1/bills/edit.twig +++ b/resources/views/v1/bills/edit.twig @@ -17,8 +17,8 @@

{{ 'mandatoryFields'|_ }}

- {% if rules.count > 0 %} - {{ ExpandedForm.text('name',null, {helpText: trans_choice('firefly.bill_edit_rules', rules.count)}) }} + {% if rules.count() > 0 %} + {{ ExpandedForm.text('name',null, {helpText: trans_choice('firefly.bill_edit_rules', rules.count())}) }} {% else %} {{ ExpandedForm.text('name') }} {% endif %} diff --git a/resources/views/v1/bills/show.twig b/resources/views/v1/bills/show.twig index 05c2f751bb..7efc81111f 100644 --- a/resources/views/v1/bills/show.twig +++ b/resources/views/v1/bills/show.twig @@ -85,7 +85,7 @@

{{ 'bill_related_rules'|_ }}

- {% if rules.count > 0 %} + {% if rules.count() > 0 %}
    {% for rule in rules %}
  • {{ rule.title }} @@ -116,7 +116,7 @@ {% endif %} - {% if attachments.count > 0 %} + {% if attachments.count() > 0 %}

    {{ 'attachments'|_ }}

    diff --git a/resources/views/v1/budgets/delete.twig b/resources/views/v1/budgets/delete.twig index 523f8e8781..be71b1d140 100644 --- a/resources/views/v1/budgets/delete.twig +++ b/resources/views/v1/budgets/delete.twig @@ -25,8 +25,8 @@

    - {% if budget.transactionjournals.count > 0 %} - {{ Lang.choice('form.budget_keep_transactions', budget.transactionjournals.count, {count: budget.transactionjournals.count }) }} + {% if budget.transactionjournals.count() > 0 %} + {{ Lang.choice('form.budget_keep_transactions', budget.transactionjournals.count(), {count: budget.transactionjournals.count() }) }} {% endif %}

    diff --git a/resources/views/v1/budgets/index.twig b/resources/views/v1/budgets/index.twig index b296cd689e..1e0b0fa08d 100644 --- a/resources/views/v1/budgets/index.twig +++ b/resources/views/v1/budgets/index.twig @@ -197,7 +197,7 @@ {% endif %}
    {% endif %} - {% if budgets|length == 0 and inactive.count == 0 %} + {% if budgets|length == 0 and inactive.count() == 0 %} {% include 'partials.empty' with {objectType: 'default', type: 'budgets',route: route('budgets.create')} %} {# make FF ignore demo for now. #} {% set shownDemo = true %} @@ -243,7 +243,7 @@ {% endif %} {% endif %} - {% if budget.attachments.count > 0 %} + {% if budget.attachments.count() > 0 %} {% endif %} @@ -284,7 +284,7 @@ style="display:none;"> {% endfor %} {% endif %} - {% if budget.budgeted|length < currencies.count %} + {% if budget.budgeted|length < currencies.count() %} @@ -394,7 +394,7 @@
- {% if paginator.count > 0 and inactive.count > 0 %} + {% if paginator.count() > 0 and inactive.count() > 0 %}
diff --git a/resources/views/v1/budgets/show.twig b/resources/views/v1/budgets/show.twig index d4cfbdb76a..0c18acd7b1 100644 --- a/resources/views/v1/budgets/show.twig +++ b/resources/views/v1/budgets/show.twig @@ -6,7 +6,7 @@ {% block content %}
-
+

@@ -38,7 +38,7 @@ {% endif %}

- {% if attachments.count > 0 %} + {% if attachments.count() > 0 %}
diff --git a/resources/views/v1/categories/delete.twig b/resources/views/v1/categories/delete.twig index 2873573ec5..9d5c4dec09 100644 --- a/resources/views/v1/categories/delete.twig +++ b/resources/views/v1/categories/delete.twig @@ -24,8 +24,8 @@

- {% if category.transactionjournals.count > 0 %} - {{ Lang.choice('form.category_keep_transactions', category.transactionjournals.count, {count: category.transactionjournals.count }) }} + {% if category.transactionjournals.count() > 0 %} + {{ Lang.choice('form.category_keep_transactions', category.transactionjournals.count(), {count: category.transactionjournals.count() }) }} {% endif %}

diff --git a/resources/views/v1/categories/index.twig b/resources/views/v1/categories/index.twig index 4754267898..e73ec09bdf 100644 --- a/resources/views/v1/categories/index.twig +++ b/resources/views/v1/categories/index.twig @@ -5,7 +5,7 @@ {% endblock %} {% block content %} - {% if categories.count > 0 %} + {% if categories.count() > 0 %}
diff --git a/resources/views/v1/categories/show.twig b/resources/views/v1/categories/show.twig index 5865a04a12..0c519ee6c7 100644 --- a/resources/views/v1/categories/show.twig +++ b/resources/views/v1/categories/show.twig @@ -8,7 +8,7 @@
{% if Route.getCurrentRoute.getName == 'categories.show' %} {# both charts #} -
+

@@ -20,7 +20,7 @@

-
+

@@ -35,7 +35,7 @@ {% endif %} {% if Route.getCurrentRoute.getName == 'categories.show.all' %} {# all chart #} -
+

@@ -48,7 +48,7 @@

{% endif %} - {% if attachments.count > 0 %} + {% if attachments.count() > 0 %}
diff --git a/resources/views/v1/debug.twig b/resources/views/v1/debug.twig index be2616835c..ab629b8f23 100644 --- a/resources/views/v1/debug.twig +++ b/resources/views/v1/debug.twig @@ -38,6 +38,7 @@ Debug information generated at {{ now }} for Firefly III version **{{ FF_VERSION | BCscale | {{ bcscale }} | | DB drivers | {{ drivers }} | | Current driver | {{ currentDriver }} | +| DB version | {{ foundDBversion }} (exp. {{ expectedDBversion}}) | | Login provider | {{ loginProvider }} | | Trusted proxies (.env) | {{ trustedProxies }} | diff --git a/resources/views/v1/list/accounts.twig b/resources/views/v1/list/accounts.twig index eed834c4e5..02e3e21b48 100644 --- a/resources/views/v1/list/accounts.twig +++ b/resources/views/v1/list/accounts.twig @@ -36,7 +36,7 @@ {% if account.location %} {% endif %} - {% if account.attachments.count > 0 %} + {% if account.attachments.count() > 0 %} {% endif %} diff --git a/resources/views/v1/list/bills.twig b/resources/views/v1/list/bills.twig index 92fb9047df..958ba080d3 100644 --- a/resources/views/v1/list/bills.twig +++ b/resources/views/v1/list/bills.twig @@ -38,7 +38,7 @@ {% endif %} {{ entry.name }} {# count attachments #} - {% if entry.attachments.count > 0 %} + {% if entry.attachments.count() > 0 %} {% endif %} diff --git a/resources/views/v1/list/categories.twig b/resources/views/v1/list/categories.twig index de31f39fc8..115f4a131c 100644 --- a/resources/views/v1/list/categories.twig +++ b/resources/views/v1/list/categories.twig @@ -25,7 +25,7 @@ {{ category.name }} - {% if category.attachments.count > 0 %} + {% if category.attachments.count() > 0 %} {% endif %} diff --git a/resources/views/v1/list/piggy-banks.twig b/resources/views/v1/list/piggy-banks.twig index b7e010d120..12f0bc8d1f 100644 --- a/resources/views/v1/list/piggy-banks.twig +++ b/resources/views/v1/list/piggy-banks.twig @@ -41,7 +41,7 @@ {{ piggy.name }} - {% if piggy.attachments.count > 0 %} + {% if piggy.attachments.count() > 0 %} {% endif %} diff --git a/resources/views/v1/piggy-banks/show.twig b/resources/views/v1/piggy-banks/show.twig index 5dba31c53b..100e99feda 100644 --- a/resources/views/v1/piggy-banks/show.twig +++ b/resources/views/v1/piggy-banks/show.twig @@ -117,7 +117,7 @@
{% endif %} - {% if attachments.count > 0 %} + {% if attachments.count() > 0 %}
diff --git a/resources/views/v1/rules/index.twig b/resources/views/v1/rules/index.twig index 2e4bcb4072..0bb763b408 100644 --- a/resources/views/v1/rules/index.twig +++ b/resources/views/v1/rules/index.twig @@ -55,7 +55,7 @@ {{ ruleGroup.description }}

- {% if ruleGroup.rules.count > 0 %} + {% if ruleGroup.rules.count() > 0 %} @@ -120,7 +120,7 @@
{% if rule.strict %}{{ 'rule_is_strict'|_ }}{% else %}{{ 'rule_is_not_strict'|_ }}{% endif %}