diff --git a/app/Http/Controllers/RuleController.php b/app/Http/Controllers/RuleController.php index 95be7efc5f..005c849bdc 100644 --- a/app/Http/Controllers/RuleController.php +++ b/app/Http/Controllers/RuleController.php @@ -263,7 +263,7 @@ class RuleController extends Controller // set value so create routine will not overwrite URL: Session::put('rules.rule.create.fromStore', true); - return redirect(route('rules.rule.create', [$request->input('what')]))->withInput(); + return redirect(route('rules.rule.create', [$ruleGroup]))->withInput(); } // redirect to previous URL. diff --git a/app/Rules/Actions/AddTag.php b/app/Rules/Actions/AddTag.php index af28acc579..f1b4bd659f 100644 --- a/app/Rules/Actions/AddTag.php +++ b/app/Rules/Actions/AddTag.php @@ -47,7 +47,7 @@ class AddTag implements ActionInterface // journal has this tag maybe? $tag = Tag::firstOrCreateEncrypted(['tag' => $this->action->action_value, 'user_id' => Auth::user()->id]); - $count = $journal->tags()->where('id', $tag->id)->count(); + $count = $journal->tags()->where('tag_id', $tag->id)->count(); if ($count == 0) { $journal->tags()->save($tag); }