Web client: Billing Full Details Shows Blank Grid

Bug #1846038 reported by John Yorio
44
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
3.2
Fix Released
High
Unassigned
3.3
Fix Released
High
Unassigned

Bug Description

Evergreen 3.3.4
Chrome and Firefox

If you look at the Full Details for a bill and click the Details link there, billing information does not appear in the grid labeled Bills.

Steps to reproduce:

Go to a patron that has bills with outstanding bills.
Click on the Bills tab.
Right-click on the desired bill and choose Full Details or double-click on the item.
Click on Details on the next screen.
The grid for Bills is blank save for the amount which shows $0.00
Payments, if any have been made, show normally on their grid.

On the grid for Bills, if you click Manage Columns and then close that window, the screen refreshes and the expected data appears.

Bill details should automatically appear when staff go to that screen.

My steps use a patron that has outstanding bills but it works for patrons with paid bills as well.

Revision history for this message
Eva Cerninakova (ece) wrote :

I have replicated the described steps in Evergreen 3.3.2. The Grid for Bills is not blank and shows the expected amount. I have checked both Firefox and Chrome.
Probably the problem is specific for Evergreen 3.3.4 or (e.g.) is related to specific settings.

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Confirming that this issue was introduced in 3.3.4, we did not see it on 3.3.3.

I suspect it is a side effect of the fix for bug 1790169. I don't see any other changes between 3.3.3 and 3.3.4 that would cause it.

Revision history for this message
Jason Etheridge (phasefx) wrote :

TypeError: Cannot read property 'target_copy' of null
at bills.js:933

Changed in evergreen:
assignee: nobody → Jason Etheridge (phasefx)
Revision history for this message
Jason Etheridge (phasefx) wrote :

The target_copy exception is a red herring. I've narrowed it down to the grid.dataProvider.refresh(); statement in configLoadPromise

Revision history for this message
Jason Etheridge (phasefx) wrote :
Changed in evergreen:
assignee: Jason Etheridge (phasefx) → nobody
tags: added: pullrequest
Revision history for this message
Rogan Hamby (rogan-hamby) wrote :

Works for me. Signoff here: user/rogan/lp1846038_billing_full_details

tags: added: signed
tags: added: signedoff
removed: signed
Revision history for this message
Dan Wells (dbw2) wrote :

Grabbed this a little bit ago hoping for an easy win, but still looking at it cross-eyed. It appears to work, but does anyone know why this works? That's what I'm looking into, but would welcome some education.

Changed in evergreen:
status: New → In Progress
assignee: nobody → Dan Wells (dbw2)
Revision history for this message
Jason Etheridge (phasefx) wrote :

It is a bit of voodoo to me, but it was my first instinct for a solution and it worked. Something isn't settled until that execution thread finishes, and that timeout kicks the refresh onto a new thread.

Revision history for this message
Dan Wells (dbw2) wrote :

I worked on this a bit yesterday with Bill, and we got off in the weeds on some ancillary bugs, but now that I can finally reliably test columns sorting/saving, I'll push a branch soon, along with some details of what I learned. Spoiler alert: I think we don't need the line at all.

Revision history for this message
Dan Wells (dbw2) wrote :

Okay, so Bill gave me a lesson in why $timeout() helps in general, which seemed worth passing along in brief, even if just as review. JavaScript is processed as an event loop, and adding a $timeout(), even if no delay is specified, still tells the execution queue to process the contained function on the *next* event loop iteration. This guarantees anything already in the call stack will finish before the $timeout-wrapped code gets a chance to run. It is generally preferred to chain execution dependencies and maintain order via promises, but $timeout() is simple and can get you out of jam. (If I have oversimplified, please comment!)

Fortunately, in this case, I think the jam doesn't actually exist. As Jeff D. pointed out, the changes meant to fix column sort saving included the problematic line, but I wonder if this was included inadvertently in the WIP branch, as there is no mention of it, and it actually appears unnecessary in testing and debugging. Here is some more light reading from the commit message:

Bug LP#1790169 added the ability to save sorting configuration, but it also added an additional grid refresh to the configuration load. This breaks grid loading.

The expected flow is for is to first load any existing configuration, then do the first collect() for the grid. This refresh() call adds potentially a second collect() which may run earlier than it should,
and overall does not seem necessary.

To test:

(Make sure you are testing on current master or rel_3_3/3_4, or you will (like me) hit related bugs which have been fixed. Also, some grids (especially circ) do not honor sort for other reasons, so avoid those for now.)

1) Find a grid which has a typical get() process. Suggestion would be a basic auto grid, such as full bill details, https://localhost/eg/staff/circ/patron/11/bill/43/details .
2) Set a sort value you can see, then *save* the configuration.
3) Before the patch, billing details grid doesn't load. After patch, grid loads and still honors the defined sort.

Since I got off in the weeds on the circ sorting, I will also be opening a bug with branch shortly in that area.

Revision history for this message
Dan Wells (dbw2) wrote :

Forgot to include the branch:

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

working/user/dbwells/lp1846038_remove_extra_grid_refresh

Revision history for this message
Dan Wells (dbw2) wrote :

Double-checked with Galen, and his recollection was that this would have been for initial page loads of sort order priority, and my testing is that that particular case also still works without it. I think we're good.

Changed in evergreen:
assignee: Dan Wells (dbw2) → nobody
tags: removed: signedoff
Remington Steed (rjs7)
Changed in evergreen:
status: In Progress → Confirmed
Revision history for this message
Remington Steed (rjs7) wrote :

Tested and confirmed, this fixes the blank grid while honoring the sort setting. Here's my sign-off branch:

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

Also, I found another grid that is affected by this bug (though it doesn't allow saving a sort priority):

Local Admin -> Item Alert Types
(localhost/eg/staff/admin/local/config/copy_alert_types)

tags: added: signedoff
Changed in evergreen:
importance: Undecided → High
milestone: none → 3.4.1
Changed in evergreen:
assignee: nobody → Mike Rylander (mrylander)
Revision history for this message
Mike Rylander (mrylander) wrote :

I like it! Picked to master back through rel_3_2.

Thanks, all!

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Mike Rylander (mrylander) → nobody
Remington Steed (rjs7)
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.