Show both the course id and the archive file for duplicates when listing course archives in the admin course. (hotfix of #3114) - #3115
Closed
drgrice1 wants to merge 2 commits into
Conversation
…ives in the admin course.
The previous setup did not take into account what would happen if
multiple archive files contained the same course id. So instead of the
`listArchivedCourse` method returning a hash of the form
```perl
{
myTestCourse => {
filename => 'myTestCourse.tar.gz',
size => '605 KB'
}
}
```
it now returns a hash of the form
```perl
{
'myTestCourse.tar.gz' => {
courseID => 'myTestCourse',
size => '605 KB',
lastModified => 1778667472
}
}
```
Note that the `lastModified` key is only included because that is what
is saved in the cache file, and that is just directly returned if the
archive file has not been modified. Although, at this point it is not
used elsewhere.
Both the courseID and the filename are then displayed. The format
displayed is `myTestCourse (myTestCourse.tar.gz, 605 KB)`.
If there is also an archive file `myTestCourseAlt.tar.gz` then it will
also be listed as something like`myTestCourse (myTestCourseAlt.tar.gz, 1.6 MB)`.
drgrice1
force-pushed
the
course-archive-list-filename-hotfix
branch
from
August 5, 2026 23:33
fbe0626 to
b8a9603
Compare
drgrice1
force-pushed
the
course-archive-list-filename-hotfix
branch
from
August 5, 2026 23:39
b8a9603 to
648d556
Compare
Contributor
|
Closing in favor of #3117. |
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.
The previous setup did not take into account what would happen if multiple archive files contained the same course id. So instead of the
listArchivedCoursemethod returning a hash of the form{ myTestCourse => { filename => 'myTestCourse.tar.gz', size => '605 KB' } }it now returns a hash of the form
{ 'myTestCourse.tar.gz' => { courseID => 'myTestCourse', size => '605 KB', lastModified => 1778667472 } }Note that the
lastModifiedkey is only included because that is what is saved in the cache file, and that is just directly returned if the archive file has not been modified. Although, at this point it is not used elsewhere.In addition when duplicate courseIDs are seen each of those in the hash will contain the
duplicateCourseIDkey.Then both the courseID and the filename are then displayed for those archives that are duplicate courseIDs. The format displayed is