From 6e90e51f0cca4707b40d45c9b2d5617dfdfeb858 Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Mon, 15 Nov 2021 17:19:20 +0000 Subject: [PATCH] [PLUGIN][CONTROLLER][Repeat] Fixed Repeat controller to update note_repeat table on removal. --- plugins/Repeat/Controller/Repeat.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/Repeat/Controller/Repeat.php b/plugins/Repeat/Controller/Repeat.php index 275c245e93..3f453095f5 100644 --- a/plugins/Repeat/Controller/Repeat.php +++ b/plugins/Repeat/Controller/Repeat.php @@ -150,8 +150,15 @@ class Repeat extends Controller $form_remove_repeat->handleRequest($request); if ($form_remove_repeat->isSubmitted()) { if ($remove_repeat_note) { + // Remove the note itself DB::remove($remove_repeat_note); DB::flush(); + + // Remove from the note_repeat table + $opts = ['note_id' => $id]; + $remove_note_repeat = DB::find('note_repeat', $opts); + DB::remove($remove_note_repeat); + DB::flush(); } if (array_key_exists('from', $get_params = $this->params())) {