Bug #8044
Session deletion doesn't delete session-specific resources from DB
100%
Description
- create a session (let's say session.id = 6)
- add a course to the session
- go to the session-course
- create a document (this one is specific to the session 6
- go to the list of sessions
- delete session 6
- the session is deleted but the document remains in c_document with a session_id = 6
This probably happens with all other resources that can be session-specific. It has to be fixed for all of them (deleting those resources).
I have added (today) a deletion of session-specific items in c_item_property because it generated a foreign key constraint error, but those records in c_item_property could probably be used to find the resources to be deleted. Otherwise use the code found in the course deletion process. There's probably an exhaustive list there.
The code should be added to the sessionmanager.lib.php::delete() function (before c_item_property deletion).
Files
Associated revisions
Delete c_document and c_item_propery see #8044
History
Updated by Julio Montoya almost 4 years ago
- Status changed from Assigned to Needs more info
- Assignee changed from Julio Montoya to Yannick Warnier
Updated by Yannick Warnier almost 4 years ago
- Status changed from Needs more info to Needs testing
- % Done changed from 0 to 80
Updated by Yannick Warnier almost 4 years ago
- File files.png files.png added
- Status changed from Needs testing to Assigned
- Assignee changed from Yannick Warnier to Julio Montoya
- % Done changed from 80 to 70
That's almost OK, but I have a weird effect here: there is still a /certificates folder that remains... See the last 5 lines of the database table: the /certificates folder appears once as deleted and then another one as not deleted but belonging to session 4 as well...!?
Updated by Yannick Warnier almost 4 years ago
- Status changed from Assigned to Needs testing
- Assignee changed from Julio Montoya to Yannick Warnier
Updated by Yannick Warnier almost 4 years ago
- Status changed from Needs testing to Bug resolved
- Assignee changed from Yannick Warnier to Julio Montoya
- % Done changed from 70 to 100
Tested and approved, although I might not have tested all the possibilities...
Delete documents inside a session see #8044