Skip to content

Firefly III: a personal finances manager

Fixes #417

James Colef0fd5324eab7
diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php
index 4326b8c2af..71089f6b81 100644
--- a/app/Http/Controllers/ReportController.php
+++ b/app/Http/Controllers/ReportController.php
@@ -227,6 +227,12 @@ class ReportController extends Controller
return redirect(route('reports.index'));
}
+ if ($request->getCategoryList()->count() === 0 && $reportType === 'category') {
+ Session::flash('error', trans('firefly.select_more_than_one_category'));
+
+ return redirect(route('reports.index'));
+ }
+
if ($end < $start) {
return view('error')->with('message', trans('firefly.end_after_start_date'));
}
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index f40af9d8d3..47f30e970e 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -524,6 +524,7 @@ return [
'no_transactions_account' => 'There are no transactions (in this period) for asset account ":name".',
'no_data_for_chart' => 'There is not enough information (yet) to generate this chart.',
'select_more_than_one_account' => 'Please select more than one account',
+ 'select_more_than_one_category' => 'Please select more than one category',
// categories:
'new_category' => 'New category',