Problems with deleting a page / person when page is on a watchlist
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
Changed in mahara: | |
milestone: | 23.04.0 → none |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
no longer affects: | mahara |
Reviewed: https:/ /reviews. mahara. org/c/mahara/ +/13521 /git.mahara. org/mahara/ mahara/ commit/ 58166a84bbb9cc5 bfd29d3901f834e 1806e64ce8
Committed: https:/
Submitter: "Robert Lyon <email address hidden>"
Branch: main
commit 58166a84bbb9cc5 bfd29d3901f834e 1806e64ce8
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: I612ade99363625 cbb4c8f85d9ed4c 3c429c32efd
Signed-off-by: Robert Lyon <email address hidden>