Bug 31455 - Batch modification tool orders found items by itemnumber
Summary: Batch modification tool orders found items by itemnumber
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Lucas Gass
QA Contact: Joonas Kylmälä
URL:
Keywords:
Depends on: 28445
Blocks:
  Show dependency treegraph
 
Reported: 2022-08-24 21:39 UTC by Lucas Gass
Modified: 2023-06-08 22:27 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00,22.05.05,21.11.12


Attachments
Bug 31455: Make batchMod sort by order scanned (3.74 KB, patch)
2022-09-01 17:00 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 31455: Make batchMod sort by order scanned (3.80 KB, patch)
2022-09-01 19:05 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 31455: Make batchMod sort by order scanned (3.95 KB, patch)
2022-09-01 19:47 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 31455: (QA follow-up) Make table creation O(N) (1.92 KB, patch)
2022-09-01 19:47 UTC, Joonas Kylmälä
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2022-08-24 21:39:35 UTC
When using the batch mod tools and entering in a set of barcodes the table of found items is ordered by itemnumber instead of by the order in which the barcodes were scanned.

This is a problem for librarians who scan a batch of books and then get a table ordered completely different.
Comment 1 Lucas Gass 2022-09-01 17:00:57 UTC
Created attachment 140052 [details] [review]
Bug 31455: Make batchMod sort by order scanned

To test:
1. In batch item deletion and batch item modification add some barcodes.
2. Notice they are being sorted by item number, not in the order scanned.
3. Appply patch and restart services.
4. Try scanning items again in both batch item deletion and batch item modification.
5. The found barcodes should now sort by order scanned.
Comment 2 Owen Leonard 2022-09-01 19:05:25 UTC
Created attachment 140059 [details] [review]
Bug 31455: Make batchMod sort by order scanned

To test:
1. In batch item deletion and batch item modification add some
   barcodes.
2. Notice they are being sorted by item number, not in the order
   scanned.
3. Appply patch and restart services.
4. Try scanning items again in both batch item deletion and batch item
   modification.
5. The found barcodes should now sort by order scanned.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Joonas Kylmälä 2022-09-01 19:47:08 UTC
Created attachment 140061 [details] [review]
Bug 31455: Make batchMod sort by order scanned

To test:
1. In batch item deletion and batch item modification add some
   barcodes.
2. Notice they are being sorted by item number, not in the order
   scanned.
3. Appply patch and restart services.
4. Try scanning items again in both batch item deletion and batch item
   modification.
5. The found barcodes should now sort by order scanned.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 4 Joonas Kylmälä 2022-09-01 19:47:11 UTC
Created attachment 140062 [details] [review]
Bug 31455: (QA follow-up) Make table creation O(N)

We can insert the indices before the main loop to a hash,
this way we don't have to look up during each loop iteration
the index from an array which in the worst case might take O(N)
thus making the total time complexity O(N^2).

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 5 Tomás Cohen Arazi 2022-09-12 18:37:18 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 Lucas Gass 2022-09-16 15:23:28 UTC
Backported to 22.05.x for 22.05.05
Comment 7 Arthur Suzuki 2022-09-21 15:09:24 UTC
Thanks!

Pushed to 21.11 for 21.11.12
Comment 8 Fridolin Somers 2022-10-10 08:29:24 UTC
We could have define no sort by default like in batch record modification : 
"aaSorting": [],
Comment 9 Fridolin Somers 2022-10-10 08:35:40 UTC
(In reply to Arthur Suzuki from comment #7)
> Thanks!
> 
> Pushed to 21.11 for 21.11.12

Ich I dont see first patch in 21.11.x :

https://git.koha-community.org/Koha-community/Koha/commits/branch/21.11.x/search?q=31455
Comment 10 Victor Grousset/tuxayo 2022-10-13 15:07:59 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document it seems, note: mark resolved when the issue with 21.11 missing a patch is resolved.