Problems with deleting a page / person when page is on a watchlist

Bug #1998860 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
21.10
Fix Released
High
Unassigned
22.04
Fix Released
High
Unassigned
22.10
Fix Released
High
Unassigned
23.04
Fix Released
High
Unassigned

Bug Description

There are couple of issues around watchlists and queued items

To test - problem one:

1) Create a site and add some people to it
2) Create a group and add some people as members
3) As group creator add a page to the group and add a block to the page
4) Masquerade as another group member and view the page - add page to watchlist
5) As this group member edit the page and add a block
6) Then straight away delete the block and go to the group portfolios page and delete the page (do this quickly to beat cron)

You get an error:
ERROR: update or delete on table "view" violates foreign key constraint "watcqueu_vie_fk" on table "watchlist_queue"

This is because when you edit a page that is being watched the watchlist_queue table gets populated with changes and when you delete the block the line isn't removed from the watchlist_queue just the block ID (as it is still a valid view change - the block deletion) so when you try and delete the page it's still referenced.

We need to remove the reference on page deletion

To test - problem two:

1-5) The same steps as above
6) Stop masquerading as other person and delete person

Person deletes successfully but they are still referenced in the watchlist_queue table - we need to remove those references on person deletion so we don't try and send a notification to a deleted person

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/c/mahara/+/13521
Committed: https://git.mahara.org/mahara/mahara/commit/58166a84bbb9cc5bfd29d3901f834e1806e64ce8
Submitter: "Robert Lyon <email address hidden>"
Branch: main

commit 58166a84bbb9cc5bfd29d3901f834e1806e64ce8
Author: Robert Lyon <email address hidden>
Date: Mon Nov 28 10:22:28 2022 +1300

Bug 1998860: watchlist_queue needs cleanup on usr/view/block delete

If one was to delete a usr/view/block that referenced in the
watchlist_queue then we get an error

Change-Id: I612ade99363625cbb4c8f85d9ed4c3c429c32efd
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "22.10_DEV" branch: https://reviews.mahara.org/c/mahara/+/13584

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/c/mahara/+/13584
Committed: https://git.mahara.org/mahara/mahara/commit/6a35e7d81f860eb2ee8c21ef6a33ceea618fa025
Submitter: "Robert Lyon <email address hidden>"
Branch: 22.10_DEV

commit 6a35e7d81f860eb2ee8c21ef6a33ceea618fa025
Author: Robert Lyon <email address hidden>
Date: Thu Dec 22 14:48:59 2022 +1300

Bug 1998860: watchlist_queue needs cleanup on usr/view/block delete

If one was to delete a usr/view/block that referenced in the
watchlist_queue then we get an error

Change-Id: I612ade99363625cbb4c8f85d9ed4c3c429c32efd
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "22.04_DEV" branch: https://reviews.mahara.org/c/mahara/+/13564

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/c/mahara/+/13564
Committed: https://git.mahara.org/mahara/mahara/commit/b28a115a42659bd073008b354fa33fd0f60ae1ad
Submitter: "Robert Lyon <email address hidden>"
Branch: 22.04_DEV

commit b28a115a42659bd073008b354fa33fd0f60ae1ad
Author: Robert Lyon <email address hidden>
Date: Thu Dec 22 14:48:59 2022 +1300

Bug 1998860: watchlist_queue needs cleanup on usr/view/block delete

If one was to delete a usr/view/block that referenced in the
watchlist_queue then we get an error

Change-Id: I612ade99363625cbb4c8f85d9ed4c3c429c32efd
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 6a35e7d81f860eb2ee8c21ef6a33ceea618fa025)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "21.10_DEV" branch: https://reviews.mahara.org/c/mahara/+/13565

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/c/mahara/+/13565
Committed: https://git.mahara.org/mahara/mahara/commit/a268b5d303d683121746de2d8d9fe247b0ed5514
Submitter: "Robert Lyon <email address hidden>"
Branch: 21.10_DEV

commit a268b5d303d683121746de2d8d9fe247b0ed5514
Author: Robert Lyon <email address hidden>
Date: Thu Dec 22 14:48:59 2022 +1300

Bug 1998860: watchlist_queue needs cleanup on usr/view/block delete

If one was to delete a usr/view/block that referenced in the
watchlist_queue then we get an error

Change-Id: I612ade99363625cbb4c8f85d9ed4c3c429c32efd
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 6a35e7d81f860eb2ee8c21ef6a33ceea618fa025)
(cherry picked from commit b28a115a42659bd073008b354fa33fd0f60ae1ad)

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 23.04.0 → none
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
no longer affects: mahara
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.