Clear button does not work for Holdings Template Editor

Bug #1803584 reported by Sarah Childs
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.2
Fix Released
Medium
Unassigned

Bug Description

When you are creating and editing templates in the Holdings Template Editor (former Volume/Copy Template Editor), the clear button has no discernible effects. Any templates or values which have been applied, stay applied. In the Holdings Editor it actually clears all applied values, so I would expect it to do the same in the Template Editor. In order to clear the values in the Template Editor, you currently have to refresh the page. I'm in Evergreen Indiana and experiencing this in both our live 3.1 and demo server 3.2.

Sarah Childs (sarahc)
summary: - Clear button does not work for Holdings Template
+ Clear button does not work for Holdings Template Editor
Revision history for this message
Jason Boyer (jboyer) wrote :

Looks like a reference to MultiMap was added to the wrong clearWorking() function. The template editor dies trying to clear that while it't not currently possible to clear multiple items when editing them. This fixes it:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/jboyer/lp1803584_clear_editor working/user/jboyer/lp1803584_clear_editor

To test:

Pre-load, go to the template editor, change anything and then click Clear. Nothing will change and if you look at the console you'll see an error about setting a property on 'undefined'.

After loading, clicking the button will clear changes to the template editor and no error will be logged (about this... there are other errors that have appeared recently but don't appear to cause problems).

After loading you'll also be able to clear all items when editing multiple. You can see this by either making massive changes to multiple items or following through the debugger and just not saving.

Jason Boyer (jboyer)
tags: added: pullrequest
Jason Boyer (jboyer)
Changed in evergreen:
milestone: none → 3.2.3
Jason Boyer (jboyer)
Changed in evergreen:
milestone: 3.2.3 → 3.next
Jason Boyer (jboyer)
Changed in evergreen:
milestone: 3.next → 3.3-beta1
Changed in evergreen:
milestone: 3.3-beta1 → 3.3-rc
Beth Willis (willis-a)
Changed in evergreen:
assignee: nobody → Beth Willis (willis-a)
Revision history for this message
Beth Willis (willis-a) wrote :

This code works as described on our system running EG 3.2.4.

I was able to clear values from a template while creating a new template and while editing an existing template.

On our EG 3.1.8 system (without this code applied), when trying to clear values from a new template or editing an existing template, there were no visible changes to the template interface and the following error was generated:

TypeError: Cannot set property 'statcat_filter' of undefined
    at app.js:2528
    at Object.o [as forEach] (vendor.bundle.js:6)
    at f.$scope.clearWorking (app.js:2527)
    at fn (eval at compile (vendor.bundle.js:6), <anonymous>:4:156)
    at r (vendor.bundle.js:6)
    at f.$eval (vendor.bundle.js:6)
    at f.$apply (vendor.bundle.js:6)
    at HTMLButtonElement.<anonymous> (vendor.bundle.js:6)
    at HTMLButtonElement.dispatch (jquery.min.js:2)
    at HTMLButtonElement.y.handle (jquery.min.js:2)

I was able to clear values from the copy editor while editing multiple copies in both systems, with and without this code.

Beth Willis (willis-a)
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Beth Willis (willis-a) wrote :

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:
assignee: Beth Willis (willis-a) → nobody
Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

New branch pushed:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1803584-copy-edit-template-clear

1. Adds mine and Beth's signoff to Jason's patch.
2. Adds a second patch to avoid JS/console errors when clearing templates, caused by code recently added to master.

tags: removed: signedoff
Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Changed in evergreen:
milestone: 3.3-rc → 3.3.1
Changed in evergreen:
milestone: 3.3.1 → 3.3.2
Revision history for this message
Galen Charlton (gmc) wrote :

I note that Bill's follow-up patch is the belt to the suspenders I propose in 1830394.

Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Dan Pearl (dpearl)
Changed in evergreen:
assignee: Galen Charlton (gmc) → Dan Pearl (dpearl)
Dan Pearl (dpearl)
tags: added: signedoff
Changed in evergreen:
assignee: Dan Pearl (dpearl) → nobody
Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Changed in evergreen:
milestone: 3.3.2 → 3.3.3
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master, rel_3_3, and rel_3_2. Thanks, Jason, Beth, and Bill!

The bug also appears to affect 3.1, but it looks like this fix may be dependent on getting bug 1830394 backported to 3.1 first.

Changed in evergreen:
importance: Undecided → Medium
assignee: Galen Charlton (gmc) → nobody
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
Revision history for this message
Janet Schrader (jschrader) wrote :

We now have this fix on release 3.2.8.

I hope I'm wrong about this, but I think there may be a bug created with this fix. When using the "clear" button in the item template editor and then creating a new template. The new template is saved with an unset circ library. When using the new template to add items the process fails silently as the item has no circ library.

Steps:
-Open the Item template editor
-Make a new template and save it
-Click on the clear button
-Make another new template and save it
-Create an item with the first template and click on 'save & exit'
-Refresh the OPAC view and item is created
-Create an item with the second template and click on 'save & exit'
-Refresh the OPAC view, no item is created and there is no warning that it did not get created

You can also see the circ library is unset just by applying the template created after using the 'clear' button

Janet

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

I cannot replicate Janet's problem in our 3-2-8 system. I followed the steps she indicated and included a circulation library in both templates. I was able to create and save new items using both templates and did the circulation library was correct for both.

Revision history for this message
Janet Schrader (jschrader) wrote :

Hi Beth,
You are correct, we are able to confirm both templates work if the circ library IS stored in the template. The problem is if the circ library is NOT stored in the template.

Our documentation doesn't include this as a field that needs to be saved. We have some libraries that use the same templates for more than one branch, they would need more templates if they stored the circ library field.

I realize that the odds of someone of our member clearing the template fields and creating a new template with the circ library stored as unset are pretty small because 1.) our libraries now have established template files and 2.) we've always told them to start over from clicking on 'add holdings' for each new template to avoid saving any fields that were not cleared from the previous xul template. But I still see it as a bug for the unwary.

Revision history for this message
Beth Willis (willis-a) wrote : Re: [Bug 1803584] Re: Clear button does not work for Holdings Template Editor

HI Janet,

I knew I must be missing something. It did not occur to me that templates
would be saved without circ library filled in, but I can see how that might
be helpful in the instance you cite.

Beth

On Thu, Nov 14, 2019 at 1:35 PM Janet Schrader <email address hidden> wrote:

> Hi Beth,
> You are correct, we are able to confirm both templates work if the circ
> library IS stored in the template. The problem is if the circ library is
> NOT stored in the template.
>
> Our documentation doesn't include this as a field that needs to be
> saved. We have some libraries that use the same templates for more than
> one branch, they would need more templates if they stored the circ
> library field.
>
> I realize that the odds of someone of our member clearing the template
> fields and creating a new template with the circ library stored as unset
> are pretty small because 1.) our libraries now have established template
> files and 2.) we've always told them to start over from clicking on 'add
> holdings' for each new template to avoid saving any fields that were not
> cleared from the previous xul template. But I still see it as a bug for
> the unwary.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1803584
>
> Title:
> Clear button does not work for Holdings Template Editor
>
> Status in Evergreen:
> Fix Released
> Status in Evergreen 3.2 series:
> Fix Released
>
> Bug description:
> When you are creating and editing templates in the Holdings Template
> Editor (former Volume/Copy Template Editor), the clear button has no
> discernible effects. Any templates or values which have been applied,
> stay applied. In the Holdings Editor it actually clears all applied
> values, so I would expect it to do the same in the Template Editor. In
> order to clear the values in the Template Editor, you currently have
> to refresh the page. I'm in Evergreen Indiana and experiencing this in
> both our live 3.1 and demo server 3.2.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/evergreen/+bug/1803584/+subscriptions
>

--
Beth Willis
Digital & Catalog Librarian
NOBLE, Inc.
42 Cherry Hill Drive
Danvers, MA 01923

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

PINES libraries also have holdings templates with the circ library unset.

We do need to occasionally create new templates (if a shelving location is added, for example).

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

Hi Janet,

I have tested this again and still can't get it to fail. In this case,
neither of my templates have the circ library valued stored in them.
However, when I create an item and apply the first template, a value
displays for the circ library (left over from a previous items?). I can
save the item and exit. When I create a new item, apply the second
template and edit the circ library field, I can save and exit with no
problem. So, I am not sure if I still am doing something different than
you are doing.

Beth

On Thu, Nov 14, 2019 at 1:35 PM Janet Schrader <email address hidden> wrote:

> Hi Beth,
> You are correct, we are able to confirm both templates work if the circ
> library IS stored in the template. The problem is if the circ library is
> NOT stored in the template.
>
> Our documentation doesn't include this as a field that needs to be
> saved. We have some libraries that use the same templates for more than
> one branch, they would need more templates if they stored the circ
> library field.
>
> I realize that the odds of someone of our member clearing the template
> fields and creating a new template with the circ library stored as unset
> are pretty small because 1.) our libraries now have established template
> files and 2.) we've always told them to start over from clicking on 'add
> holdings' for each new template to avoid saving any fields that were not
> cleared from the previous xul template. But I still see it as a bug for
> the unwary.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1803584
>
> Title:
> Clear button does not work for Holdings Template Editor
>
> Status in Evergreen:
> Fix Released
> Status in Evergreen 3.2 series:
> Fix Released
>
> Bug description:
> When you are creating and editing templates in the Holdings Template
> Editor (former Volume/Copy Template Editor), the clear button has no
> discernible effects. Any templates or values which have been applied,
> stay applied. In the Holdings Editor it actually clears all applied
> values, so I would expect it to do the same in the Template Editor. In
> order to clear the values in the Template Editor, you currently have
> to refresh the page. I'm in Evergreen Indiana and experiencing this in
> both our live 3.1 and demo server 3.2.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/evergreen/+bug/1803584/+subscriptions
>

--
Beth Willis
Digital & Catalog Librarian
NOBLE, Inc.
42 Cherry Hill Drive
Danvers, MA 01923

Revision history for this message
Janet Schrader (jschrader) wrote :

I think you are doing something different.
When someone adds holdings, the circ library of the workstation or of library selected in Holdings View if you start from there, is automatically filled in. When you apply a template that has NOT been created after using the 'clear' button, the circ library is saved in the item record and the item is created even if that field is not saved in the template.

You said when you applied the second template you "edit the circ library field". Did you have to edit the field for the circ library to be there? If the field was blank before the edit, that means the second template had the field saved as unset.

When we first transitioned to the web client we did have some staff that applied the wrong template, cleared it and applied a different one. Creating the item failed silently because clearing the item record screen also clears out the circ library, and unless it's saved in a template, or added manually, it will not be there. The working 'clear' button on the "Item templates" tab does the same thing now.

There is no warning that the circ library field is missing. The 'save & exit' button does not get grayed out. Since that appears to be a required field, perhaps that's something that could also be reported as a bug.

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.