Checkin screen "trim list" setting is buggy in web client

Bug #1747963 reported by Remington Steed on 2018-02-07
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Medium
Unassigned
3.0
Medium
Unassigned

Bug Description

The "Checkin Items" screen has a checkbox at the bottom that says "Trim List (20 Rows)". In the old client, checking this box kept the table limited to 20 rows, trimming off old rows from the bottom. In the web client, it does something strange when the table first reaches 20 rows, leaving only one old row in the table. The cause seems to be a mix-up between the JavaScript functions "splice()" and "slice()". Branch on the way...

Remington Steed (rjs7) wrote :

Here's the branch:

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

And from the commit message:

    The use of splice() here caused buggy behavior and seemed to be a typo,
    so I tried using slice() instead. But that still didn't work correctly.
    The list stopped adding items after it reached 21 total, so scanning a
    new barcode didn't add it to the list but only refreshed the list.

    Instead, this commit sets the length of the array to 20, which shortens
    the array as described in the MDN documentation for Array.length. Now it
    behaves like it did in the XUL client.

tags: added: pullrequest
Cesar V (cesardv) wrote :

All Hail Remingtron! Master of arrays! :)
This works great man, thanks! Yeah, it looks like using slice() would actually generate a copy array and mess up the reference between the grid and the checkin service. Just truncating it by changing the length of the actual array in-place does the trick.

Here's a signoff branch for it:
http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/cesardv/rsteed_lp1747963_checkin_trim_list_fix-signoff

Remington Steed (rjs7) on 2018-03-16
Changed in evergreen:
milestone: none → 3.1-rc
importance: Undecided → Medium
Cesar V (cesardv) on 2018-03-16
tags: added: signedoff
Changed in evergreen:
status: New → Confirmed
Bill Erickson (berick) on 2018-03-21
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Bill Erickson (berick) wrote :

Issue and fix confirmed. Master of arrays, indeed. Thanks Remington, Cesar, and Terran.

Fix committed to master and rel_3_0.

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Bill Erickson (berick) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers