Skip to content

Firefly III: a personal finances manager

Fix #4235

James Cole24b7543f7265
diff --git a/app/Helpers/Report/PopupReport.php b/app/Helpers/Report/PopupReport.php
index 01cefdc1bf..36d7ec389b 100644
--- a/app/Helpers/Report/PopupReport.php
+++ b/app/Helpers/Report/PopupReport.php
@@ -27,6 +27,7 @@ use FireflyIII\Models\Account;
use FireflyIII\Models\Budget;
use FireflyIII\Models\Category;
use FireflyIII\Models\TransactionType;
+use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use Illuminate\Support\Collection;
@@ -206,10 +207,17 @@ class PopupReport implements PopupReportInterface
$repository = app(JournalRepositoryInterface::class);
$repository->setUser($account->user);
+ $accountRepository = app(AccountRepositoryInterface::class);
+ $accountRepository->setUser($account->user);
+
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
- $collector->setAccounts(new Collection([$account]))
+ // set report accounts + the request accounts:
+ $set = $attributes['accounts'] ?? new Collection;
+ $set->push($account);
+
+ $collector->setBothAccounts($set)
->setRange($attributes['startDate'], $attributes['endDate'])
->withAccountInformation()
->withBudgetInformation()
diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php
index 45ae265aa8..39d4366b26 100644
--- a/routes/breadcrumbs.php
+++ b/routes/breadcrumbs.php
@@ -57,7 +57,7 @@ if (!function_exists('limitStringLength')) {
$length = \strlen($string);
$result = $string;
if ($length > $maxChars) {
- $result = substr_replace($string, ' ... ', $maxChars / 2, $length - $maxChars);
+ $result = substr_replace($string, ' ... ', (int)($maxChars / 2), $length - $maxChars);
}
return $result;