New Holdings Editor allows you to overwrite "magic" item statuses

Bug #1999401 reported by Benjamin Murphy
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
3.9
Fix Released
High
Unassigned

Bug Description

In the angular holdings editor (3.9.1) you can overwrite "protected" items statuses if you have the item status set as part of your templates. Certain transactional statuses should not be able to be overwritten.

Prior to update, there were hard coded "magic statuses"

    service.get_magic_statuses = function() {
        /* TODO: make these more configurable per lp1616170 */
        return $q.when([
             1 /* Checked out */
            ,3 /* Lost */
            ,6 /* In transit */
            ,8 /* On holds shelf */
            ,16 /* Long overdue */
            ,18 /* Canceled Transit */
        ]);
    }

Now, it seems that the new holdings editor should instead restrict overwriting, perhaps when
config.copy_status where restrict_copy_delete = 't'

(I don't think this is a dup of 1616170, but feel free to merge if so?)

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

This is also occurring in 3.10.

I can't directly edit those statuses in the holdings editor but can, as Benjamin notes, apply a template with status "available" and have that status overwrite the others on save.

Changed in evergreen:
status: New → Confirmed
Michele Morgan (mmorgan)
tags: added: cat-holdingseditor
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Here's a branch for your consideration: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sandbergja/lp1999401-magic-statuses-in-templates

Here are the testing notes from the commit message (there is also a jasmine test in the branch):

1. Create a new template in the holdings template editor with a few different values in various fields.
2. Include a "magic" status in your template (like Lost or In Transit). To select it, you can type the first few characters then press <Tab>.
3. Save your template.
4. Apply your template to an item.
5. Note that the copy status has changed to a magic status.
6. Apply this patch.
7. Try applying your template to another item.
8. Note that the copy status field doesn't change this time, but other fields from your template should still apply.

tags: added: pullrequest
Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
Revision history for this message
Elaine Hardy (ehardy) wrote :

One of our catalogers is reporting this also happens when the status in the template is "in process"

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

Reviewing Jane's branch, it does prevent a template from applying a magic status to an item, as described in her testing notes.

However, the original bug report is for the opposite and more serious problem of overwriting a magical status in an item with a non-magical one. The following steps illustrate the problem.

1. Create a holdings template that applies the status 'Available'
2. Retrieve a Checked out item in the angular holdings editor
3. Apply the template
4. Save the item

Note that the status of the item is now Available, despite the open circulation.

Jane's patch certainly is valuable but overwriting magical statuses with non-magical statuses is a bigger issue.

Removing the pullrequest for now, and setting importance to High.

Changed in evergreen:
importance: Undecided → High
tags: added: cat-templates
removed: pullrequest
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Hahahaha well, I got that backwards! Claiming this again to re-work my patch.

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

Second commit available on the same branch that prevents magic statuses from being overwritten by templates.

Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
tags: added: pullrequest
Revision history for this message
Terran McCanna (tmccanna) wrote :

Copying testing notes from Jane's second commit here:

1. Create a new template including a status
2. Check out an item
3. Apply your template to the item
4. Note that the item's status is no longer Checked Out
5. Apply this patch
6. Retry steps 1-3. Note that the item's status is still Checked Out

Revision history for this message
Elizabeth Davis (elidavis) wrote :

I followed Jane's testing notes steps 1 through 3. In the two templates I tried, it didn't change the checked out or lost status to the status in the templates.

I have tested this and consent to signing off on it- <email address hidden>- PaILS

Michele Morgan (mmorgan)
tags: added: signedoff
Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Michele Morgan (mmorgan) wrote :

This works great to protect magical statuses in items from being changed by templates, and also to prevent magical statuses from being applied by templates. Pushed to master and rel_3_10. I encountered a conflict so this has not yet been pushed to rel_3_9.

Thanks Jane and Elizabeth!

While working on this, I discovered that Jane's steps to create the template with the magic status:

2. Include a "magic" status in your template (like Lost or In Transit). To select it, you can type the first few characters then press <Tab>.

can also be used to directly edit an item's status. I will open another bug about that issue.

Changed in evergreen:
status: Confirmed → Fix Committed
no longer affects: evergreen/3.10
Changed in evergreen:
milestone: none → 3.10.1
Revision history for this message
Michele Morgan (mmorgan) wrote :

This has now been pushed to rel_3_9 also.

I opened bug 2009211 to address directly editing into a magic status.

Changed in evergreen:
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.