Wishlist: course materials users should be able to un-archive old courses

Bug #1895706 reported by Jane Sandberg
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

The course materials modules allows staff to archive courses. It would be helpful to also offer an option to un-archive these courses, hopefully bringing back the materials that were formerly attached to the course.

Possibly, it should also bring back the course users with a public role (e.g. Instructors). It shouldn't bring back any students, though.

This would help staff members re-use courses, saving them some time.

Kyle Huckins (khuckins)
Changed in evergreen:
assignee: nobody → Kyle Huckins (khuckins)
Revision history for this message
Kyle Huckins (khuckins) wrote :

I've pushed a cursory fix here: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/khuckins/lp1895706-unarchive-courses

It will need to be built alongside 1939994 once that is complete in order to see its full benefit, as the Course Page button to unarchive a course will only appear if the UI understands the course is archived.

Unfortunately, due to the way Course Materials is designed, I don't see a simple path to re-associating course materials. Course users, however, are automatically retained by design - reopening a course will strip the course of non-public users. Is there a full list

tags: added: pullrequest
Changed in evergreen:
assignee: Kyle Huckins (khuckins) → nobody
Revision history for this message
Beth Willis (willis-a) wrote :

I tested this code on our server (EG-3-8-0) as follows:

—Selected a course from the Course List

–From the Course Page, I selected the "Archive Course" button

–The course page displayed with a new "Unarchive Course" button and with the "Archive Course" button disabled; the lock icon also displayed before the course title

–After refreshing the page, the "Unarchive Course" button no longer displayed on the Course record editor.
 The "Unarchive Course" button also does not display on the Course Materials page, but the items correctly displayed as no longer associated with the course.

Because the new "Unarchive Course" button is not displaying, I cannot determine whether this function works. Note: we do have the fix for bug https://bugs.launchpad.net/evergreen/+bug/1939994

I think that the status of the course would be clearer to the user if either the "Archive Course" button or the "Unarchive Course" button -- but not both -- displayed on the Course Editor and Course Materials pages, depending upon the actual status of the course.

The attached file contains screenshots showing the sequence of steps and the related displays.

Revision history for this message
Kyle Huckins (khuckins) wrote :

Thanks Beth! I've pushed an update that should resolve this - for anyone else testing this, the branch will need to be merged on top of 1939994 now, as it utilizes a variable introduced in that bug's fix.

Revision history for this message
Beth Willis (willis-a) wrote :

Kyle,

Thanks for this update.

I wanted to start fresh in testing this fix so I completed the following steps on our server (EG 3-8-0):

Added a new course
Associated multiple items with the course
Selected "Archive Course" button

I waited several seconds and nothing happened. I checked the console and saw this error:

ERROR Error: Uncaught (in promise): open-ils.courses.detach_material failed! stat=500 msg= *** Call to [open-ils.courses.detach_material] failed for session [0.85948212428128581647965277845], thread trace [0]:
Can't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.28.1/OpenILS/Utils/CStoreEditor.pm line 616.

    at T (polyfills.9b26e9b6c6d2049cc2b1.js:1:12874)
    at T (polyfills.9b26e9b6c6d2049cc2b1.js:1:12402)
    at polyfills.9b26e9b6c6d2049cc2b1.js:1:13683
    at l.invokeTask (polyfills.9b26e9b6c6d2049cc2b1.js:1:7920)
    at Object.onInvokeTask (main.8224bc24f26fd2140d2a.js:1:379338)
    at l.invokeTask (polyfills.9b26e9b6c6d2049cc2b1.js:1:7841)
    at i.runTask (polyfills.9b26e9b6c6d2049cc2b1.js:1:3329)
    at m (polyfills.9b26e9b6c6d2049cc2b1.js:1:9914)
    at u.invokeTask [as invoke] (polyfills.9b26e9b6c6d2049cc2b1.js:1:8999)
    at p (polyfills.9b26e9b6c6d2049cc2b1.js:1:21253)

Revision history for this message
Beth Willis (willis-a) wrote :

I also attempted to use the new "Unarchive Course" button to unarchive a course that had previously been archived. I encountered the same error as noted in comment #4.

Revision history for this message
Kyle Huckins (khuckins) wrote (last edit ):

This is very strange, having trouble replicating this - are there any other branches related to Course Materials loaded(besides the archived course handling one)? Wondering if there may be a conflict with another in the batch of Course Reserves bugs.

Revision history for this message
Beth Willis (willis-a) wrote :

Yes, we have loaded several other branches related to Course Materials. Perhaps there is a conflict. Would it help to know which other branches have been loaded?

Revision history for this message
Kyle Huckins (khuckins) wrote :

Definitely, that'll help narrow down the cause

Michele Morgan (mmorgan)
Changed in evergreen:
milestone: none → 3.9-beta
Revision history for this message
Blake GH (bmagic) wrote :

There is a property issue during compile time:

src/app/staff/admin/local/course-reserves/course-page.component.ts:71:22 - error TS2339: Property 'courseIsArchived' does not exist on type 'CoursePageComponent'.

Revision history for this message
Michele Morgan (mmorgan) wrote :

Just confirming I am seeing the same issue as Blake when compiling the angular files.

Removing the pullrequest tag.

tags: added: needswork
removed: pullrequest
Revision history for this message
Kyle Huckins (khuckins) wrote :

I've pushed a quick fix to this - the issue arises when the patch for lp1939994 is not applied. The additional commit removes references to courseIsArchived, but the added commit should be ignored when merging the branch into any other branch already containing lp1939994

tags: added: pullrequest
removed: needswork
Changed in evergreen:
milestone: 3.9-beta → none
Revision history for this message
Beth Willis (willis-a) wrote (last edit ):

EG 3-8-0

I have tested this patch and it works as described by Kyle. Note: we do have the patch for lp1939994 on our server and did remove the additional commit when merging this branch to our server, as noted in comment #11.

I have tested this code and consent to signing off on it with my name, Beth Willis and my email address, <email address hidden>.

tags: added: signedoff
Changed in evergreen:
status: New → Confirmed
Changed in evergreen:
milestone: none → 3.10-beta
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Jane Sandberg (sandbergja) → nobody
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks, Kyle and Beth! Merged for inclusion in 3.10. I took the liberty of adjusting the toast messages to match the terminology in Michele's commit c74d59b4699e761ebc914501c60c5fbcad0e2623.

I broke off the desired feature of adding back course materials on un-archive into bug #1994906

Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.