This commit is contained in:
James Cole
2020-08-26 19:41:50 +02:00
parent 59ab0c9f0d
commit c985683ee3

View File

@@ -143,6 +143,12 @@ class CreateController extends Controller
$oldTriggers = $this->getTriggersForBill($bill); $oldTriggers = $this->getTriggersForBill($bill);
$oldActions = $this->getActionsForBill($bill); $oldActions = $this->getActionsForBill($bill);
// restore actions and triggers from old input:
if ($request->old()) {
$oldTriggers = $this->getPreviousTriggers($request);
$oldActions = $this->getPreviousActions($request);
}
$triggerCount = count($oldTriggers); $triggerCount = count($oldTriggers);
$actionCount = count($oldActions); $actionCount = count($oldActions);
$subTitleIcon = 'fa-clone'; $subTitleIcon = 'fa-clone';
@@ -179,8 +185,6 @@ class CreateController extends Controller
// get triggers and actions for journal. // get triggers and actions for journal.
$oldTriggers = $this->getTriggersForJournal($journal); $oldTriggers = $this->getTriggersForJournal($journal);
$oldActions = []; $oldActions = [];
$triggerCount = count($oldTriggers);
$actionCount = count($oldActions);
$this->createDefaultRuleGroup(); $this->createDefaultRuleGroup();
$this->createDefaultRule(); $this->createDefaultRule();
@@ -192,6 +196,15 @@ class CreateController extends Controller
'description' => (string) trans('firefly.new_rule_for_journal_description', ['description' => $journal->description]), 'description' => (string) trans('firefly.new_rule_for_journal_description', ['description' => $journal->description]),
]; ];
// restore actions and triggers from old input:
if ($request->old()) {
$oldTriggers = $this->getPreviousTriggers($request);
$oldActions = $this->getPreviousActions($request);
}
$triggerCount = count($oldTriggers);
$actionCount = count($oldActions);
// flash old data // flash old data
$request->session()->flash('preFilled', $preFilled); $request->session()->flash('preFilled', $preFilled);