Can Still Delete Shelving Locations with Items Attached

Bug #2002435 reported by John Amundson
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.9
Fix Released
Medium
Unassigned

Bug Description

Evergreen 3.10

LP Bug #1910546 introduced a fix that stops a user from deleting a shelving location with non-deleted items attached from the Local Admin > Shelving Locations Editor interface.

However, this only stops the user from using the Actions > Delete Selected option. Users can still Edit Selected and then flip the "Is Deleted?" flag to true on any location regardless of if non-deleted items are still attached.

If non-deleted items are attached, the system should also prevent this edit from occurring.

Revision history for this message
John Amundson (jamundson) wrote :

Also noting that it appears that staff with just "UPDATE_COPY_LOCATION" permission can delete locations using the edit method outlined here. This should only be allowed with the DELETE_COPY_LOCATION permission.

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Smol patch available here: user/sandbergja/lp2002435-protect-shelving-locations-from-deletion

To test:
1. Go to the Local Admin > Shelving Locations Editor screen
2. Select a location and edit it.
3. Note that with this patch in place, the Delete checkbox
is no longer editable.

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

Also affects 3.9.1

Revision history for this message
John Amundson (jamundson) wrote :

Thanks, Jane!

One question for the community - this patch will prevent the ability to un-delete locations in the staff client. Do we care about losing this functionality?

The ability to un-delete (or even see deleted db entries) in the staff client is not the norm, so I would be okay with taking away the ability. See related bug about seeing deleted shelving locations - Bug #1917092

Revision history for this message
Tiffany Little (tslittle) wrote :

Seems like since there's a specific perm for it already that it should be allowable in the UI to both delete/undelete if you've got the perm.

Revision history for this message
Elaine Hardy (ehardy) wrote :

I think you should be able to undelete. People make mistakes and being able to restore a location deleted in error would be nice.

Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Good point! I pushed a second commit to my branch to add an undelete action to that screen.

Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
Changed in evergreen:
status: New → Confirmed
Revision history for this message
John Amundson (jamundson) wrote :

Thanks, Jane!

The Undelete option appears to look at permission UPDATE_COPY_LOCATION, which makes sense to me.

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

tags: added: signedoff
Changed in evergreen:
importance: Undecided → Medium
milestone: none → 3.10.1
Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Michele Morgan (mmorgan) wrote :

This works great to prevent directly editing the "deleted" field in the shelving location.

Pushed to master, rel_3_10 and rel_3_9.

Thanks Jane and John!

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Michele Morgan (mmorgan) → nobody
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.