Skip to content

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
openwebwork:mainfrom
drgrice1:course-archive-list-filename-hotfix
Closed

Show both the course id and the archive file for duplicates when listing course archives in the admin course. (hotfix of #3114)#3115
drgrice1 wants to merge 2 commits into
openwebwork:mainfrom
drgrice1:course-archive-list-filename-hotfix

Conversation

@drgrice1

@drgrice1 drgrice1 commented Aug 5, 2026

Copy link
Copy Markdown
Member

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

{
    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 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.

In addition when duplicate courseIDs are seen each of those in the hash will contain the duplicateCourseID key.

Then both the courseID and the filename are then displayed for those archives that are duplicate courseIDs. The format displayed is

notDuplicatedCourseID (2 GB)
myTestCourse (myTestCourse.tar.gz, 605 KB)
myTestCourse (myTestCourseAlt.tar.gz, 1.6 MB)

…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
drgrice1 force-pushed the course-archive-list-filename-hotfix branch from fbe0626 to b8a9603 Compare August 5, 2026 23:33
@Alex-Jordan

Copy link
Copy Markdown
Contributor

Closing in favor of #3117.

@Alex-Jordan Alex-Jordan closed this Aug 6, 2026
@drgrice1
drgrice1 deleted the course-archive-list-filename-hotfix branch August 6, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants