Reapplying item template with alert or note results in multiple alerts and/or notes

Bug #1855144 reported by Beth Willis
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned
3.10
Fix Released
Undecided
Unassigned

Bug Description

If an item template that includes an item alert or item note is applied to an item multiple times, the alert and/or note is added to that item multiple times. There is no visible indicator that the alert and/or note now exist more than once. (Actually, there is no indicator that *any* alert or note exist for that item.) See related bug: https://bugs.launchpad.net/evergreen/+bug/1833458

Our libraries typically use item templates when cataloging. It is easy to reapply a template inadvertently. Additionally, a user may modify a template to change one or more attributes (e.g. loan duration, shelving location) before reapplying it to edit a batch of items. In this case, all of those items will have the item note and/or alert duplicated.

At check in and/or check out, depending upon the type of alert, one alert appears, but the alert text is repeated multiple times. This is not as bad as having the alert pop-up multiple times, but is still unnecessary and potentially confusing.

Beth Willis (willis-a)
tags: added: itemtemplates
Beth Willis (willis-a)
tags: added: cat-templates
removed: itemtemplates
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

EG 3.11 Angular volcopy editor, here is working branch for this issue.

user/stompro/lp1855144_angular_volcopy_template_skipdupitemalerts

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

This checks for existing alerts that match the same type, note and temporary status and skips adding them again for each copy.

So if you are editing 10 copies, and half of them have the alert already, then only the ones without the alert would get it applied.

I based this off of the branch for Bug 1983156, but I think it can be applied on it's own.

Testing Notes:

1. Create a copy template that includes one or more item alerts.
  Use the AngularJS holdings editor to do so Admin -> local admin ->
  Holdings Template Editor.

2. After saving, log out and back in. I've noticed my template
   edits in the AngularJS interface sometimes don't make it
   to the Angular interface witout logging out and back in.

3. Edit an item in the Angular holdings editor
   /eg2/en-US/staff/cat/volcopy/holdings/item/xxxx

4. Apply the template several times and save the copy.

5. Check for duplicate item alerts.

There will also be a console for message about duplicate
alerts being detected when applying the template.

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

Feedback testing:
1. I created a template
2. Logged out and back in again.
3. Edited an item and applied my template several times and saved it.
4. I checked the item alerts and only see the one set but didn't see any of the notes that are in the template.
5. Created another new template.
6. Edited the same item and applied the template several times and saved it.
7. I now see both templates alerts and neither of the templates' notes.

Both templates had Normal Checkin and Normal checkout alerts.

Barcode- CONC40000580

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

Tested on server: https://terran-main.gapines.org

This code works as described. If a template is created in the standalone template editor (Admin -> local admin -> Holdings Template Editor) and the template includes an item alert, this alert will display only once, regardless of how many times the template is applied to a single item.

Note: this bug title references both item alerts and item notes, but this branch does not relate to item notes. These still do not work when included in holdings templates.

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
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Hello Elizabeth, my fix is only for Alerts... it doesn't address notes. I don't think notes are supported in templates at all right now. Bug 1989790 addresses that. How were you adding your notes to your templates?

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

HI Josh, I was adding in the standalone template editor (Admin -> local admin -> Holdings Template Editor). My apologies for the confusion.

Changed in evergreen:
milestone: none → 3.12-beta
Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Michele Morgan (mmorgan) wrote :

Looks great! Pushed to main, rel_3_11 and rel_3_10.

Adjusting targets as this is a bugfix.

Thanks Josh, Beth and Elizabeth!

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