[Bugfix:CourseMaterials] Fix Course Materials Directory Deletion#12064
Merged
[Bugfix:CourseMaterials] Fix Course Materials Directory Deletion#12064
Conversation
…course-materials-directory-deletion
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12064 +/- ##
============================================
- Coverage 21.69% 21.69% -0.01%
Complexity 9587 9587
============================================
Files 268 268
Lines 36591 36593 +2
Branches 475 475
============================================
Hits 7940 7940
- Misses 28180 28182 +2
Partials 471 471
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
JManion32
approved these changes
Sep 16, 2025
Contributor
JManion32
left a comment
There was a problem hiding this comment.
I reproduced the issue on main and confirmed that this PR resolves it. Just make sure you resolve that small PHP lint failure, the failing Cypress tests are unrelated. Great work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why is this Change Important & Necessary?
Fixes #11923 by invoking
CourseMaterialsCleanup#cleanupEmptyDirectoriesAfterDeletionfollowing a change to a file's path.What is the New Behavior?
Prior to this fix, switching the directory of the example file

cell1_source.txt(from the attached issue) to the top directory would yield entries in the course materials section of the given course as follows:Now, the entries with IDs of 260 and 261 would no longer be present in the database as they are empty and as such have been removed.
What steps should a reviewer take to reproduce or test the bug or new feature?
Described in the attached issue.
Automated Testing & Documentation
Other information