Bug 39633 - Inventory tool DataTable doesn't properly load
Summary: Inventory tool DataTable doesn't properly load
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 36496
Blocks:
  Show dependency treegraph
 
Reported: 2025-04-14 20:14 UTC by Lucas Gass (lukeg)
Modified: 2025-05-26 08:20 UTC (History)
6 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00,24.11.05
Circulation function:


Attachments
Bug 39633: Use column names to get table settings (3.40 KB, patch)
2025-04-14 20:17 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 39633: Use column names to get table settings (3.46 KB, patch)
2025-04-17 19:03 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 37784: (QA follow-up) Add few tables to Koha::Database::Columns (1.81 KB, patch)
2025-04-18 06:47 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 39633: Use column names to get table settings (3.55 KB, patch)
2025-04-22 12:18 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2025-04-14 20:14:07 UTC
To recreate:

1. Cataloging > Inventory
2. Run the tool without uploaded barcodes 
3. Table loads and you see all the DataTable controls ( Table settings, etc )
4. Run the tool while uploading at least 1 barcode 
5. No DataTable controls 


This is because when we pass table settings through we don't know if the "Seen" column will who or not. It should use column names
Comment 1 Lucas Gass (lukeg) 2025-04-14 20:15:28 UTC
Also, when setting the default sort order we check `compareinv2barcd`. It should check uploadedbarcodesflag because the column only shows when when there is the uploadedbarcodesflag template variable
Comment 2 Lucas Gass (lukeg) 2025-04-14 20:17:12 UTC
Created attachment 180939 [details] [review]
Bug 39633: Use column names to get table settings

1. Cataloging > Inventory
2. Run the tool without uploaded barcodes
3. Table loads and you see all the DataTable controls ( Table settings, etc )
4. Run the tool while uploading at least 1 barcode
5. No DataTable controls
6. APPLY PATCH
7. Try steps 1 -4 again, making sure everything now works.
Comment 3 Biblibre Sandboxes 2025-04-17 19:03:54 UTC
Created attachment 181131 [details] [review]
Bug 39633: Use column names to get table settings

1. Cataloging > Inventory
2. Run the tool without uploaded barcodes
3. Table loads and you see all the DataTable controls ( Table settings, etc )
4. Run the tool while uploading at least 1 barcode
5. No DataTable controls
6. APPLY PATCH
7. Try steps 1 -4 again, making sure everything now works.

Signed-off-by: Sam <sam.sowanick@corvallisoregon.gov>
Comment 4 Marcel de Rooy 2025-04-18 06:47:07 UTC
Created attachment 181147 [details] [review]
Bug 37784: (QA follow-up) Add few tables to Koha::Database::Columns

This resolves exceptions like:
Invalid table name accountlines at /usr/share/koha/C4/Reports/Guided.pm line 216.

Test plan:
Go to reports/dictionary.pl
Try to add a new definition for Serials.
Without this patch, you would crash (status 500).
Run t/Koha/Database/Columns.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Katrin Fischer 2025-04-22 06:39:43 UTC
Marcel, can you please check on this bug? The second patch doesn't seem to belong to this bug and the first patch doesn't have your sign-off line?
Comment 6 Marcel de Rooy 2025-04-22 12:18:30 UTC
Created attachment 181252 [details] [review]
Bug 39633: Use column names to get table settings

1. Cataloging > Inventory
2. Run the tool without uploaded barcodes
3. Table loads and you see all the DataTable controls ( Table settings, etc )
4. Run the tool while uploading at least 1 barcode
5. No DataTable controls
6. APPLY PATCH
7. Try steps 1 -4 again, making sure everything now works.

Signed-off-by: Sam <sam.sowanick@corvallisoregon.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Marcel de Rooy 2025-04-22 12:18:52 UTC
(In reply to Katrin Fischer from comment #5)
> Marcel, can you please check on this bug? The second patch doesn't seem to
> belong to this bug and the first patch doesn't have your sign-off line?

Fixed.
Comment 8 Katrin Fischer 2025-04-22 12:19:34 UTC
Thanks!
Comment 9 Katrin Fischer 2025-04-23 07:43:24 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 10 Fridolin Somers 2025-04-23 13:31:43 UTC
(In reply to Lucas Gass (lukeg) from comment #1)
> Also, when setting the default sort order we check `compareinv2barcd`. It
> should check uploadedbarcodesflag because the column only shows when when
> there is the uploadedbarcodesflag template variable

Hi, why changing the order number ?
                     // sort on callnumber
-                    "order": [[ 1, "asc" ]],
+                    "order": [[ 2, "asc" ]],

Looks like callnumber is still second column in this case.

Code in the other case says :
                    // 3rd column is callnumber
                    "order": [[ 2, "asc" ]],
Comment 11 Paul Derscheid 2025-05-22 18:25:06 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.05