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 %}