[PLUGIN][CONTROLLER][Repeat] Fixed Repeat controller to update note_repeat table on removal.

This commit is contained in:
Eliseu Amaro 2021-11-15 17:19:20 +00:00 committed by Hugo Sales
parent b71e869843
commit 6e90e51f0c
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -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())) {