Course Materials: Course owner used as call_number.owning_lib when removing items from a Course

Bug #1939730 reported by Michele Morgan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.8
Fix Released
Medium
Unassigned

Bug Description

We discovered this issue while working with courses owned at the System level, but attaching items owned at the Branch level.

If we attached a branch owned item to the system owned course, and edited the call number, it was not possible to remove the item from the course. The action failed with 'Disassociation of Course Material failed or was not allowed'

To test this on a concerto system:

- Set the org unit setting 'Opt Org Unit into the Course Materials Module' to True
- Navigate to Administration - Local Administration - Course Reserves List
- Select the stock course 'History of Indonesia' and choose Edit Selected from the Actions menu
- Click on the Course materials tab
- Enter the barcode of an item you wish to attach to the course
- Enter a different call number for the item while on reserve
- Click Add Material, note that the item has been added to the list
- Select the item you have just added, and select Remove Selected under the Actions menu

You should see the toast: 'Disassociation of Course Material failed or was not allowed'

We also found the following issue when logged in at BR1 as a user with MANAGE_RESERVES permission at the System level

- Create a course owned by BR1
- Attach an item owned by BR2 to the BR1 course and edit the call number
- Select the item you have just added, and select Remove Selected under the Actions menu
- Note that the item now has BR1 as owning_lib and circ_lib.

Digging deeper, we found that when the system attempts to revert the item's call number, it is using the course owner as call number owning_lib to match an existing call number or create a new call number for the item. Using the original call number's owning_lib to find or create the call number when removing the item is more appropriate and solves these issues.

I'll post a patch for consideration shortly.

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

Promised patch for consideration is here:

user/mmorgan/lp1939730_use_original_call_number_owning_lib_when_removing_item_from_course

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/mmorgan/lp1939730_use_original_call_number_owning_lib_when_removing_item_from_course

tags: added: pullrequest
Revision history for this message
Terran McCanna (tmccanna) wrote :
Changed in evergreen:
status: New → Confirmed
importance: Undecided → High
importance: High → Medium
tags: added: signedoff
Revision history for this message
Galen Charlton (gmc) wrote :

Noting a question I posed to Jane via IRC: "While looking at the patch [for this bug], I noticed that archiving or deleting a course uses an entirely separate Angular code path to dissociated materials from the course, and if you've modified call numbers for any physical items, has a similar bug. However, I'm curious: why doesn't that path way use open-ils.courses.detach_material the same way that 'Remove item' from the materials list does?"

This concern probably doesn't effect this patch directly, but given that there are two pathways to the same unexpected behavior, maybe they should be treated together.

Revision history for this message
Galen Charlton (gmc) wrote :

Also, I was able to do this:

- Create a BR3 course
- Attach a BR1 item to that course and give it a different call number.
- Archive the course.
- Note that while the CN label of the item was restored, the CN owning library is now that of the course, not the item.

Revision history for this message
Evergreen Bug Maintenance (bugmaster) wrote :

Noting that Jane has opened bug 1940105.

Michele Morgan (mmorgan)
Changed in evergreen:
milestone: none → 3.7.3
no longer affects: evergreen/3.6
Changed in evergreen:
milestone: 3.7.3 → none
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks, Michele and Terran! Pushed to 3.9 and above.

Changed in evergreen:
milestone: none → 3.9.1
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
Revision history for this message
Jason Boyer (jboyer) wrote :

Also pulling this in for the (quite late) 3.8.2.

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.