Skip to content

Firefly III: a personal finances manager

Fix issues related to #3111

James Cole8d806e6a1dbb
diff --git a/app/Exceptions/GracefulNotFoundHandler.php b/app/Exceptions/GracefulNotFoundHandler.php
index 0b4b4c4ec0..5b7de43a1c 100644
--- a/app/Exceptions/GracefulNotFoundHandler.php
+++ b/app/Exceptions/GracefulNotFoundHandler.php
@@ -85,6 +85,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
return redirect(route('currencies.index'));
break;
case 'budgets.show':
+ case 'budgets.edit':
$request->session()->reflash();
return redirect(route('budgets.index'));
diff --git a/app/Services/Internal/Destroy/BudgetDestroyService.php b/app/Services/Internal/Destroy/BudgetDestroyService.php
index c3b574c3fb..2cc6377ab4 100644
--- a/app/Services/Internal/Destroy/BudgetDestroyService.php
+++ b/app/Services/Internal/Destroy/BudgetDestroyService.php
@@ -60,5 +60,8 @@ class BudgetDestroyService
// also delete all relations between categories and transactions:
DB::table('budget_transaction')->where('budget_id', (int)$budget->id)->delete();
+
+ // also delete all budget limits
+ $budget->budgetlimits()->delete();
}
}