Angular MARC import: import operations from inspect queue can fail

Bug #1941764 reported by Galen Charlton
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.6
Fix Released
Medium
Unassigned

Bug Description

When starting from a Inspect Queue from a bib queue in the Angular MARC Import, operations like 'Import Selected Record' can fail. Specifically, after selecting a record and clicking the link, the import tab is displayed but without the relevant queue showing as selected. Attempting to complete the would fail with the following error message:

  ERROR TypeError: this.selectedQueue is undefined

I traced this back to an issue with the combobox component. The combobox for the queue is passed both entries and a startId, e.g.,

      <eg-combobox [entries]="formatEntries('activeQueues')"
      <eg-combobox
         id="queue-select"
         [startId]="startQueueId"

As it happens, entries gets set first, then startId... but the setter for entries expects that startId has a value in order to apply the default selection correctly. I observed that switching the order of the startId and entries attributes can fix the problem.

Unfortunately, we cannot count on that per (e.g.):

https://github.com/angular/angular/issues/40007
https://stackoverflow.com/questions/42358507/angular2-how-to-have-input-setters-called-in-certain-order

Consequently, while it may be worth doing a quick fix to change the order of the attributes and see if that works on supported browsers, it looks like we may need to write an ngOnChanges handler for combobox.

Evergreen 3.6+

Galen Charlton (gmc)
Changed in evergreen:
importance: Undecided → Medium
tags: added: angular cataloging
description: updated
Revision history for this message
Galen Charlton (gmc) wrote :

Well, combobox already has an OnChanges handler, so we're part of the way there.

Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

As noted in IRC, I had a fix for this included in the code for bug #1842763. I've extracted the fix, improved it some, and posted it here:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1941764-vand-import-from-queue-inputs

It sidesteps the order of operations by applying both startId and selectedId (when possible) to ensure the needed value is applied one way or the other.

tags: added: pullrequest
Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
milestone: none → 3.7.2
Changed in evergreen:
assignee: nobody → Christine Morgan (cmorgan-z)
Revision history for this message
Christine Morgan (cmorgan-z) wrote :

Looks good to me! Thanks Bill and Galen!

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

Changed in evergreen:
assignee: Christine Morgan (cmorgan-z) → nobody
tags: added: signedoff
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed on down to rel_3_6. Thanks, Bill and Christine!

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