Bug 37334 - Cannot filter holdings table by status
Summary: Cannot filter holdings table by status
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Jonathan Druart
URL:
Keywords: regression
: 38686 (view as bug list)
Depends on: 33568 38512
Blocks: 39932 40002
  Show dependency treegraph
 
Reported: 2024-07-11 20:21 UTC by Lucas Gass (lukeg)
Modified: 2025-05-27 08:06 UTC (History)
26 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This restores the ability to filter the holdings table by status. This was lost when the holdings table was upgraded to use the REST API (added to Koha 24.05 by bug 33568).
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (16.46 KB, patch)
2024-10-02 12:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.27 KB, patch)
2024-10-02 12:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.38 KB, patch)
2024-10-02 12:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (17.10 KB, patch)
2024-10-28 10:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.27 KB, patch)
2024-10-28 10:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.36 KB, patch)
2024-10-28 10:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (17.09 KB, patch)
2024-11-04 21:26 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.66 KB, patch)
2024-11-04 21:26 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.41 KB, patch)
2024-11-04 21:27 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (2.99 KB, patch)
2024-11-05 14:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.66 KB, patch)
2024-11-08 23:37 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (17.14 KB, patch)
2024-11-19 17:10 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.66 KB, patch)
2024-11-19 17:10 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.41 KB, patch)
2024-11-19 17:11 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (2.99 KB, patch)
2024-11-19 17:11 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.66 KB, patch)
2024-11-19 17:11 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Return all non zero notforloan statuses (974 bytes, patch)
2024-11-19 17:11 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_available should not return notforloan statues other than 0 (835 bytes, patch)
2024-11-19 18:09 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add _status tests (5.77 KB, patch)
2024-11-19 22:27 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_checked_out tests (1.90 KB, patch)
2024-11-19 23:24 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add POD (2.56 KB, patch)
2024-11-21 18:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_in_transit tests (2.34 KB, patch)
2024-11-21 19:07 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_has_holds tests (2.27 KB, patch)
2024-11-21 21:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (915 bytes, patch)
2024-11-22 23:44 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (15.85 KB, patch)
2024-12-20 22:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.66 KB, patch)
2024-12-20 22:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.41 KB, patch)
2024-12-20 22:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (2.99 KB, patch)
2024-12-20 22:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.66 KB, patch)
2024-12-20 22:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Return all non zero notforloan statuses (974 bytes, patch)
2024-12-20 22:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_available should not return notforloan statues other than 0 (835 bytes, patch)
2024-12-20 22:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add _status tests (5.77 KB, patch)
2024-12-20 22:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_checked_out tests (1.89 KB, patch)
2024-12-20 22:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add POD (2.56 KB, patch)
2024-12-20 22:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_in_transit tests (2.34 KB, patch)
2024-12-20 22:16 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_has_holds tests (2.27 KB, patch)
2024-12-20 22:16 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (915 bytes, patch)
2024-12-20 22:16 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (15.85 KB, patch)
2024-12-30 15:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.66 KB, patch)
2024-12-30 15:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.41 KB, patch)
2024-12-30 15:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (2.99 KB, patch)
2024-12-30 15:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.66 KB, patch)
2024-12-30 15:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Return all non zero notforloan statuses (974 bytes, patch)
2024-12-30 15:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_available should not return notforloan statues other than 0 (835 bytes, patch)
2024-12-30 15:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add _status tests (5.77 KB, patch)
2024-12-30 15:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_checked_out tests (1.89 KB, patch)
2024-12-30 15:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add POD (2.56 KB, patch)
2024-12-30 15:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_in_transit tests (2.34 KB, patch)
2024-12-30 15:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_has_holds tests (2.27 KB, patch)
2024-12-30 15:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (915 bytes, patch)
2024-12-30 15:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (15.92 KB, patch)
2024-12-31 08:06 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.73 KB, patch)
2024-12-31 08:07 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.47 KB, patch)
2024-12-31 08:07 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (3.06 KB, patch)
2024-12-31 08:08 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.73 KB, patch)
2024-12-31 08:08 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Return all non zero notforloan statuses (1.02 KB, patch)
2024-12-31 08:09 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: filter_by_available should not return notforloan statues other than 0 (902 bytes, patch)
2024-12-31 08:09 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Add _status tests (5.83 KB, patch)
2024-12-31 08:10 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Add filter_by_checked_out tests (1.96 KB, patch)
2024-12-31 08:10 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Add POD (2.63 KB, patch)
2024-12-31 08:11 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Add filter_by_in_transit tests (2.40 KB, patch)
2024-12-31 08:11 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Add filter_by_has_holds tests (2.34 KB, patch)
2024-12-31 08:11 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (982 bytes, patch)
2024-12-31 08:12 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Add ability to filter by in_bundle (3.26 KB, patch)
2025-01-13 21:09 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_in_bundle tests (1.99 KB, patch)
2025-01-13 21:33 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_recall test (1.72 KB, patch)
2025-01-13 22:37 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_available tests (4.75 KB, patch)
2025-01-13 23:29 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add search tests (4.88 KB, patch)
2025-01-29 21:41 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (16.94 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.72 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.47 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (3.05 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.72 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Return all non zero notforloan statuses (1.01 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_available should not return notforloan statues other than 0 (896 bytes, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add _status tests (5.83 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_checked_out tests (1.95 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add POD (2.62 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_in_transit tests (2.40 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_has_holds tests (2.33 KB, patch)
2025-01-31 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (976 bytes, patch)
2025-01-31 21:52 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add ability to filter by in_bundle (3.26 KB, patch)
2025-01-31 21:52 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_in_bundle tests (1.98 KB, patch)
2025-01-31 21:52 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_recall test (1.72 KB, patch)
2025-01-31 21:52 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_available tests (4.28 KB, patch)
2025-01-31 21:52 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add search tests (4.88 KB, patch)
2025-01-31 21:52 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Filter in_transit by current (793 bytes, patch)
2025-02-03 11:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Fix restricted and in_bundle JS (1.26 KB, patch)
2025-02-04 20:10 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (765 bytes, patch)
2025-02-04 23:10 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add ability to filter by in_bundle (3.32 KB, patch)
2025-02-05 06:25 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: filter_by_in_bundle tests (2.04 KB, patch)
2025-02-05 06:26 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Add filter_by_recall test (1.78 KB, patch)
2025-02-05 06:26 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Add filter_by_available tests (4.34 KB, patch)
2025-02-05 06:27 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Add search tests (4.95 KB, patch)
2025-02-05 06:27 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Filter in_transit by current (856 bytes, patch)
2025-02-05 06:28 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Fix restricted and in_bundle JS (1.32 KB, patch)
2025-02-05 06:28 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (805 bytes, patch)
2025-02-05 06:29 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (17.83 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.61 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.66 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (3.17 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.81 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Return all non zero notforloan statuses (1.02 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_available should not return notforloan statues other than 0 (893 bytes, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add _status tests (5.88 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_checked_out tests (1.96 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add POD (2.62 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_in_transit tests (2.38 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_has_holds tests (2.33 KB, patch)
2025-02-11 20:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add ability to filter by in_bundle (3.35 KB, patch)
2025-02-11 20:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_in_bundle tests (2.02 KB, patch)
2025-02-11 20:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_recall test (1.78 KB, patch)
2025-02-11 20:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_available tests (4.33 KB, patch)
2025-02-11 20:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add search tests (5.41 KB, patch)
2025-02-11 20:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Filter in_transit by current (852 bytes, patch)
2025-02-11 20:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix restricted and in_bundle JS (1.35 KB, patch)
2025-02-11 20:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (801 bytes, patch)
2025-02-11 20:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (18.61 KB, patch)
2025-02-24 18:45 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.61 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.66 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (3.17 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.81 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Return all non zero notforloan statuses (1.02 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_available should not return notforloan statues other than 0 (893 bytes, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add _status tests (5.88 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_checked_out tests (1.96 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add POD (2.62 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_in_transit tests (2.38 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_has_holds tests (2.33 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (975 bytes, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add ability to filter by in_bundle (3.29 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_in_bundle tests (1.97 KB, patch)
2025-02-24 18:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_recall test (1.72 KB, patch)
2025-02-24 18:47 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_available tests (4.28 KB, patch)
2025-02-24 18:47 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add search tests (5.35 KB, patch)
2025-02-24 18:47 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Adjust number of tests in Items.t (660 bytes, patch)
2025-03-31 14:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (18.61 KB, patch)
2025-04-01 12:42 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.61 KB, patch)
2025-04-01 12:42 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.66 KB, patch)
2025-04-01 12:42 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (3.17 KB, patch)
2025-04-01 12:42 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.81 KB, patch)
2025-04-01 12:42 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Return all non zero notforloan statuses (1.02 KB, patch)
2025-04-01 12:42 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_available should not return notforloan statues other than 0 (893 bytes, patch)
2025-04-01 12:42 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add _status tests (5.70 KB, patch)
2025-04-01 12:42 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_checked_out tests (1.80 KB, patch)
2025-04-01 12:42 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add POD (2.62 KB, patch)
2025-04-01 12:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_in_transit tests (2.41 KB, patch)
2025-04-01 12:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_has_holds tests (2.35 KB, patch)
2025-04-01 12:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (975 bytes, patch)
2025-04-01 12:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add ability to filter by in_bundle (3.29 KB, patch)
2025-04-01 12:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_in_bundle tests (1.99 KB, patch)
2025-04-01 12:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_recall test (1.74 KB, patch)
2025-04-01 12:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_available tests (4.30 KB, patch)
2025-04-01 12:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add search tests (5.37 KB, patch)
2025-04-01 12:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Adjust number of tests in Items.t (1.04 KB, patch)
2025-04-01 12:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix column offset (1.09 KB, patch)
2025-04-01 13:59 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (18.58 KB, patch)
2025-04-18 14:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.61 KB, patch)
2025-04-18 14:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.66 KB, patch)
2025-04-18 14:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (3.17 KB, patch)
2025-04-18 14:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.81 KB, patch)
2025-04-18 14:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Return all non zero notforloan statuses (1.02 KB, patch)
2025-04-18 14:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_available should not return notforloan statues other than 0 (893 bytes, patch)
2025-04-18 14:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add _status tests (5.70 KB, patch)
2025-04-18 14:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_checked_out tests (1.80 KB, patch)
2025-04-18 14:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add POD (2.62 KB, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_in_transit tests (2.41 KB, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_has_holds tests (2.35 KB, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (975 bytes, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add ability to filter by in_bundle (3.29 KB, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: filter_by_in_bundle tests (1.99 KB, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_recall test (1.74 KB, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add filter_by_available tests (4.30 KB, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Add search tests (5.37 KB, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Adjust number of tests in Items.t (1.04 KB, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix column offset (1.09 KB, patch)
2025-04-18 14:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Correct logic for filtering by in_bundle (1.36 KB, patch)
2025-04-28 17:04 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items (18.70 KB, patch)
2025-05-13 12:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Allow a column filter to be shown even searchable is off (1.69 KB, patch)
2025-05-13 12:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Restore filtering holdings per status (9.76 KB, patch)
2025-05-13 12:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Fix logic for not available (3.24 KB, patch)
2025-05-13 12:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Fix restricted and notforloan filter logic (1.88 KB, patch)
2025-05-13 12:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Return all non zero notforloan statuses (1.09 KB, patch)
2025-05-13 12:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: filter_by_available should not return notforloan statues other than 0 (967 bytes, patch)
2025-05-13 12:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Add _status tests (5.97 KB, patch)
2025-05-13 12:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Add filter_by_checked_out tests (1.87 KB, patch)
2025-05-13 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Add POD (2.69 KB, patch)
2025-05-13 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Add filter_by_in_transit tests (2.48 KB, patch)
2025-05-13 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Add filter_by_has_holds tests (2.43 KB, patch)
2025-05-13 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Fix filter_by_has_recalls (1.02 KB, patch)
2025-05-13 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Add ability to filter by in_bundle (3.36 KB, patch)
2025-05-13 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: filter_by_in_bundle tests (2.06 KB, patch)
2025-05-13 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Add filter_by_recall test (1.81 KB, patch)
2025-05-13 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Add filter_by_available tests (4.37 KB, patch)
2025-05-13 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Add search tests (5.49 KB, patch)
2025-05-13 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Update Holdings_spec.ts test (1.24 KB, patch)
2025-05-16 19:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37334: Fix conflict with bug 39473 (1.48 KB, patch)
2025-05-20 12:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37334: Adjust mocked _status data (bug 39932 follow-up) (1.75 KB, patch)
2025-05-22 13:52 UTC, Tomás Cohen Arazi (tcohen)
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) 2024-07-11 20:21:53 UTC
Currently one is not able to sort the holdings table by status. IN catalogue_detail.inc I see the following: 

451                 data: "me.lost_status", 
452                 className: "status",
453                 searchable: false, // FIXME We are losing the ability to search on the status
454                 orderable: false,
455                 render: function (data, type, row, meta) {

Setting orderable to true brings back the icons, but I am assuming since this wasn't fixed initially that it is not trivial.
Comment 1 Dani Elder 2024-07-15 19:17:03 UTC
We do use this feature regularly. Thanks for fixing it.
Comment 2 Jonathan Druart 2024-10-02 12:45:06 UTC
On bug 33568 I clearly stated that we were loosing the ability to search on the status.

"""
  commit 385048f27ccb5eaeeac2e90130d621305a537960
  Bug 33568: Status

    See the FIXME in the code, we are losing the ability to search on the status,
    but this is really impossible to implement if we are not storing the
    status (DB or search engine).
"""

Actually the search is not impossible, tricky but feasible.
However the sort is clearly not possible if we don't store the status (ie. if we keep calculating it on the fly).

I think the use cases and the needs are answered with the filtering restored. I am renaming the bug to highlight that, but feel free to open a separate one if it is still problematic. But keep in mind that we need to rethink how/when/where we store and calculate the status, and it's not a trivial change.
Comment 3 Jonathan Druart 2024-10-02 12:56:06 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2024-10-02 12:56:09 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2024-10-02 12:56:12 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2024-10-02 12:56:43 UTC
I am not sure this is the best we can do, but it seems to work.

I would like, before continuing (or, better, getting help to get it done), to know if Lucas and Dani are happy with this change. Does it answer your needs?

There are more TODO:
1. Tests
2. POD
3. Discuss, rename "_status" (?)

This is ready for testing, not to be pushed however.
Comment 7 Jonathan Druart 2024-10-07 08:54:30 UTC
I am waiting for feedback.
Comment 8 Lucas Gass (lukeg) 2024-10-07 16:52:35 UTC
Thanks for your work here Jonathan, I really appreciate it. 

When I apply this patch and attempt to sort the column I get this 500 error: 


==> /var/log/koha/kohadev/plack-api-error.log <==
[2024/10/07 16:28:03] [ERROR] GET /api/v1/biblios/9/items: unhandled exception (DBIx::Class::Exception)<<DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me' in 'order clause' at /kohadevbox/koha/Koha/Objects.pm line 403>>
Comment 9 Jonathan Druart 2024-10-08 07:15:36 UTC
(In reply to Lucas Gass from comment #8)
> Thanks for your work here Jonathan, I really appreciate it. 
> 
> When I apply this patch and attempt to sort the column I get this 500 error: 
> 
> 
> ==> /var/log/koha/kohadev/plack-api-error.log <==
> [2024/10/07 16:28:03] [ERROR] GET /api/v1/biblios/9/items: unhandled
> exception
> (DBIx::Class::Exception)<<DBIx::Class::Storage::DBI::_dbh_execute(): DBI
> Exception: DBD::mysql::st execute failed: Unknown column 'me' in 'order
> clause' at /kohadevbox/koha/Koha/Objects.pm line 403>>

Which column? Status is not sortable, and sort on other columns works for me.
Comment 10 Lucas Gass (lukeg) 2024-10-08 14:51:46 UTC
(In reply to Jonathan Druart from comment #9)
> (In reply to Lucas Gass from comment #8)
> > Thanks for your work here Jonathan, I really appreciate it. 
> > 
> > When I apply this patch and attempt to sort the column I get this 500 error: 
> > 
> > 
> > ==> /var/log/koha/kohadev/plack-api-error.log <==
> > [2024/10/07 16:28:03] [ERROR] GET /api/v1/biblios/9/items: unhandled
> > exception
> > (DBIx::Class::Exception)<<DBIx::Class::Storage::DBI::_dbh_execute(): DBI
> > Exception: DBD::mysql::st execute failed: Unknown column 'me' in 'order
> > clause' at /kohadevbox/koha/Koha/Objects.pm line 403>>
> 
> Which column? Status is not sortable, and sort on other columns works for me.

Sorry, this is some misunderstanding on my part. I testing the filtering of the Status column and it works great for me. I tested with all the listed statuses. 

I did file this additional bug for SORTING of the status column:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38122
Comment 11 Jonathan Druart 2024-10-21 07:42:02 UTC
ping, Lucas?
Comment 12 David Cook 2024-10-21 22:54:34 UTC
I took a peek at the code, and this will
Comment 13 Jonathan Druart 2024-10-22 07:44:43 UTC
(In reply to David Cook from comment #12)
> I took a peek at the code, and this will

Slow down things? Yes maybe, but only if you filter on status.
Comment 14 Lucas Gass (lukeg) 2024-10-25 22:32:11 UTC
Everything works great here except for when filtering by not_for_loan status. In that case I seem to get a 500 error:

==> /var/log/koha/kohadev/plack-api-error.log <==
[2024/10/25 22:31:33] [ERROR] GET /api/v1/biblios/32/items: unhandled exception (Koha::Exceptions::Object::MethodNotCoveredByTests)<<The method Koha::ItemTypes->column is not covered by tests!
Comment 15 Jonathan Druart 2024-10-28 10:36:07 UTC Comment hidden (obsolete)
Comment 16 Jonathan Druart 2024-10-28 10:36:11 UTC Comment hidden (obsolete)
Comment 17 Jonathan Druart 2024-10-28 10:36:14 UTC Comment hidden (obsolete)
Comment 18 Jonathan Druart 2024-10-28 10:36:26 UTC
(In reply to Lucas Gass (lukeg) from comment #14)
> Everything works great here except for when filtering by not_for_loan
> status. In that case I seem to get a 500 error:
> 
> ==> /var/log/koha/kohadev/plack-api-error.log <==
> [2024/10/25 22:31:33] [ERROR] GET /api/v1/biblios/32/items: unhandled
> exception (Koha::Exceptions::Object::MethodNotCoveredByTests)<<The method
> Koha::ItemTypes->column is not covered by tests!

Fixed!
Comment 19 Lucas Gass (lukeg) 2024-11-01 22:00:36 UTC
(In reply to Jonathan Druart from comment #18)
> (In reply to Lucas Gass (lukeg) from comment #14)
> > Everything works great here except for when filtering by not_for_loan
> > status. In that case I seem to get a 500 error:
> > 
> > ==> /var/log/koha/kohadev/plack-api-error.log <==
> > [2024/10/25 22:31:33] [ERROR] GET /api/v1/biblios/32/items: unhandled
> > exception (Koha::Exceptions::Object::MethodNotCoveredByTests)<<The method
> > Koha::ItemTypes->column is not covered by tests!
> 
> Fixed!

Yes, everything seems to work great now. Can we move this out of 'In discussion', happy to add my sign off at this point.
Comment 20 Lucas Gass (lukeg) 2024-11-04 21:26:53 UTC Comment hidden (obsolete)
Comment 21 Lucas Gass (lukeg) 2024-11-04 21:26:57 UTC Comment hidden (obsolete)
Comment 22 Lucas Gass (lukeg) 2024-11-04 21:27:01 UTC Comment hidden (obsolete)
Comment 23 Lucas Gass (lukeg) 2024-11-04 21:27:34 UTC
Things are working, I am signing off to keep this moving.
Comment 24 Emmi Takkinen 2024-11-05 07:08:30 UTC
Tested this and while filtering seems to be working with every other status, available status returns either all items or items with other statuses. 

E.g. I have an item A with damaged value 2 and item B with all statuses (notforloan, damaged, withdrawn, itemlost, restricted and itype is also available for loan) as 0. Only item A is returned when I filter holdings table with "Available" status.
Comment 25 Jonathan Druart 2024-11-05 14:13:28 UTC Comment hidden (obsolete)
Comment 26 Jonathan Druart 2024-11-05 14:13:46 UTC
(In reply to Emmi Takkinen from comment #24)
> Tested this and while filtering seems to be working with every other status,
> available status returns either all items or items with other statuses. 
> 
> E.g. I have an item A with damaged value 2 and item B with all statuses
> (notforloan, damaged, withdrawn, itemlost, restricted and itype is also
> available for loan) as 0. Only item A is returned when I filter holdings
> table with "Available" status.

Indeed, lot of wrong logics in the previous version, thanks!
Comment 27 Jonathan Druart 2024-11-05 14:15:21 UTC
I won't be able to work more on this soon.

Feel free to test, but it's not ready for inclusion (hence the previous "In discussion" status). It's missing a lot of tests. Please take over if you are willing to make it move forward. The tests can be interesting to write but I won't have the time during the next weeks.
Comment 28 Nick Clemens (kidclamp) 2024-11-07 15:45:43 UTC
*** Bug 38122 has been marked as a duplicate of this bug. ***
Comment 29 Lucas Gass (lukeg) 2024-11-08 23:35:40 UTC
(In reply to Emmi Takkinen from comment #24)
> Tested this and while filtering seems to be working with every other status,
> available status returns either all items or items with other statuses. 
> 
> E.g. I have an item A with damaged value 2 and item B with all statuses
> (notforloan, damaged, withdrawn, itemlost, restricted and itype is also
> available for loan) as 0. Only item A is returned when I filter holdings
> table with "Available" status.

I tried to recreate this exact scenario and it seems to work for me. However I did find flaws with the restricted and notforloan filters.
Comment 30 Lucas Gass (lukeg) 2024-11-08 23:37:08 UTC Comment hidden (obsolete)
Comment 31 Lucas Gass (lukeg) 2024-11-08 23:38:29 UTC
I am going to put this back to into discussion.

Emmi, if you get a chance can you test again with my follow-up patches. 


Like Jonathan said, we'll still need to write a bunch of tests here.
Comment 32 Emmi Takkinen 2024-11-11 07:48:17 UTC
First patch needed a minor rebase. Filtering with at least "Available", "Checked out", "In transit", "Damaged" and "Lost" status works, but "Not for loan" status doesn't return results if its value starts with -. E.g. I have authorized values 7 "Added to bundle" and -7 "Auton varastossa". Filtering first one works, second doesn't.
Comment 33 Jonathan Druart 2024-11-19 12:54:03 UTC
(In reply to Emmi Takkinen from comment #32)
> First patch needed a minor rebase. Filtering with at least "Available",
> "Checked out", "In transit", "Damaged" and "Lost" status works, but "Not for
> loan" status doesn't return results if its value starts with -. E.g. I have
> authorized values 7 "Added to bundle" and -7 "Auton varastossa". Filtering
> first one works, second doesn't.

Yes, I think it's the correct behaviour.

C4/Reserves.pm:1322         $item->notforloan > 0  || # item with negative or zero notforloan value is holdable
Comment 34 Catrina Berka 2024-11-19 17:06:41 UTC
If I filter on Not for Loan, I would expect to see ALL values, positive or negative. Libraries using negative NFL values would want to see copies that may be on order or in processing, in addition to any that are not holdable. The filtering needs to account for any value where NFL != 0
Comment 35 Lucas Gass (lukeg) 2024-11-19 17:10:54 UTC Comment hidden (obsolete)
Comment 36 Lucas Gass (lukeg) 2024-11-19 17:10:57 UTC Comment hidden (obsolete)
Comment 37 Lucas Gass (lukeg) 2024-11-19 17:11:00 UTC Comment hidden (obsolete)
Comment 38 Lucas Gass (lukeg) 2024-11-19 17:11:03 UTC Comment hidden (obsolete)
Comment 39 Lucas Gass (lukeg) 2024-11-19 17:11:07 UTC Comment hidden (obsolete)
Comment 40 Lucas Gass (lukeg) 2024-11-19 17:11:10 UTC Comment hidden (obsolete)
Comment 41 Lucas Gass (lukeg) 2024-11-19 17:12:17 UTC
(In reply to Catrina Berka from comment #34)
> If I filter on Not for Loan, I would expect to see ALL values, positive or
> negative. Libraries using negative NFL values would want to see copies that
> may be on order or in processing, in addition to any that are not holdable.
> The filtering needs to account for any value where NFL != 0

Rebased and added a patch, based on Catrina's comment, so the notforloan filter will return ALL nfl statuses, positive or negative.
Comment 42 Lucas Gass (lukeg) 2024-11-19 17:59:41 UTC
I am noticing that filtering by available is returning items with a negative notforloan status when it should not.
Comment 43 Lucas Gass (lukeg) 2024-11-19 18:09:18 UTC Comment hidden (obsolete)
Comment 44 Lucas Gass (lukeg) 2024-11-19 22:27:24 UTC Comment hidden (obsolete)
Comment 45 Lucas Gass (lukeg) 2024-11-19 22:32:13 UTC
There is a few more tests to write here for the 'filter_by*' routines.
Comment 46 Lucas Gass (lukeg) 2024-11-19 23:24:32 UTC Comment hidden (obsolete)
Comment 47 Lucas Gass (lukeg) 2024-11-21 18:43:17 UTC Comment hidden (obsolete)
Comment 48 Lucas Gass (lukeg) 2024-11-21 18:47:32 UTC
Jonathan had an empty routine, I removed it. I don't think we need this?


sub filter_by_for_loan {

}


We can already filter by not_for_loan, available, and checked_out.
Comment 49 Lucas Gass (lukeg) 2024-11-21 19:07:23 UTC Comment hidden (obsolete)
Comment 50 Lucas Gass (lukeg) 2024-11-21 21:31:22 UTC Comment hidden (obsolete)
Comment 51 Lucas Gass (lukeg) 2024-11-21 21:32:27 UTC
Trying to write tests for filter_by_has_recalls made me realize filtering by recalls is working quite right.
Comment 52 Lucas Gass (lukeg) 2024-11-21 21:33:13 UTC
(In reply to Lucas Gass (lukeg) from comment #51)
> Trying to write tests for filter_by_has_recalls made me realize filtering by
> recalls is working quite right.

It is NOT working quite right, fix incoming.
Comment 53 Lucas Gass (lukeg) 2024-11-22 23:44:01 UTC
(In reply to Lucas Gass (lukeg) from comment #52)
> (In reply to Lucas Gass (lukeg) from comment #51)
> > Trying to write tests for filter_by_has_recalls made me realize filtering by
> > recalls is working quite right.
> 
> It is NOT working quite right, fix incoming.


filter_by_has_recalls needs to filter by item_level recalls only, anything else should be considered available.
Comment 54 Lucas Gass (lukeg) 2024-11-22 23:44:26 UTC Comment hidden (obsolete)
Comment 55 Emmi Takkinen 2024-11-26 11:46:02 UTC
Is this ready for testing?
Comment 56 Lucas Gass (lukeg) 2024-12-02 17:44:46 UTC
(In reply to Emmi Takkinen from comment #55)
> Is this ready for testing?

It is blocked by Bug 38512. I think we need to make sure the display of recalls is correct before we can continue here, please test that one first!
Comment 57 Lucas Gass (lukeg) 2024-12-18 18:22:05 UTC
This can be unblocked because Bug 38512 is PQA. It needs rebased on top of that one now, setting to patch doesn't apply and will rebase asap.
Comment 58 Lucas Gass (lukeg) 2024-12-20 22:15:27 UTC Comment hidden (obsolete)
Comment 59 Lucas Gass (lukeg) 2024-12-20 22:15:31 UTC Comment hidden (obsolete)
Comment 60 Lucas Gass (lukeg) 2024-12-20 22:15:34 UTC Comment hidden (obsolete)
Comment 61 Lucas Gass (lukeg) 2024-12-20 22:15:38 UTC Comment hidden (obsolete)
Comment 62 Lucas Gass (lukeg) 2024-12-20 22:15:41 UTC Comment hidden (obsolete)
Comment 63 Lucas Gass (lukeg) 2024-12-20 22:15:44 UTC Comment hidden (obsolete)
Comment 64 Lucas Gass (lukeg) 2024-12-20 22:15:48 UTC Comment hidden (obsolete)
Comment 65 Lucas Gass (lukeg) 2024-12-20 22:15:51 UTC Comment hidden (obsolete)
Comment 66 Lucas Gass (lukeg) 2024-12-20 22:15:54 UTC Comment hidden (obsolete)
Comment 67 Lucas Gass (lukeg) 2024-12-20 22:15:58 UTC Comment hidden (obsolete)
Comment 68 Lucas Gass (lukeg) 2024-12-20 22:16:01 UTC Comment hidden (obsolete)
Comment 69 Lucas Gass (lukeg) 2024-12-20 22:16:05 UTC Comment hidden (obsolete)
Comment 70 Lucas Gass (lukeg) 2024-12-20 22:16:08 UTC Comment hidden (obsolete)
Comment 71 Emmi Takkinen 2024-12-30 07:55:54 UTC
Patches no longer apply.

Applying: Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items
error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc).
error: could not build fake ancestor
Patch failed at 0001 Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-37334-Allow-embed-status-for-GET-bibliobiblioi-34QjuN.patch
Comment 72 Lucas Gass (lukeg) 2024-12-30 15:31:34 UTC Comment hidden (obsolete)
Comment 73 Lucas Gass (lukeg) 2024-12-30 15:31:37 UTC Comment hidden (obsolete)
Comment 74 Lucas Gass (lukeg) 2024-12-30 15:31:40 UTC Comment hidden (obsolete)
Comment 75 Lucas Gass (lukeg) 2024-12-30 15:31:44 UTC Comment hidden (obsolete)
Comment 76 Lucas Gass (lukeg) 2024-12-30 15:31:47 UTC Comment hidden (obsolete)
Comment 77 Lucas Gass (lukeg) 2024-12-30 15:31:51 UTC Comment hidden (obsolete)
Comment 78 Lucas Gass (lukeg) 2024-12-30 15:31:55 UTC Comment hidden (obsolete)
Comment 79 Lucas Gass (lukeg) 2024-12-30 15:31:58 UTC Comment hidden (obsolete)
Comment 80 Lucas Gass (lukeg) 2024-12-30 15:32:02 UTC Comment hidden (obsolete)
Comment 81 Lucas Gass (lukeg) 2024-12-30 15:32:06 UTC Comment hidden (obsolete)
Comment 82 Lucas Gass (lukeg) 2024-12-30 15:32:10 UTC Comment hidden (obsolete)
Comment 83 Lucas Gass (lukeg) 2024-12-30 15:32:13 UTC Comment hidden (obsolete)
Comment 84 Lucas Gass (lukeg) 2024-12-30 15:32:17 UTC Comment hidden (obsolete)
Comment 85 Emmi Takkinen 2024-12-31 08:06:52 UTC Comment hidden (obsolete)
Comment 86 Emmi Takkinen 2024-12-31 08:07:25 UTC Comment hidden (obsolete)
Comment 87 Emmi Takkinen 2024-12-31 08:07:53 UTC Comment hidden (obsolete)
Comment 88 Emmi Takkinen 2024-12-31 08:08:22 UTC Comment hidden (obsolete)
Comment 89 Emmi Takkinen 2024-12-31 08:08:51 UTC Comment hidden (obsolete)
Comment 90 Emmi Takkinen 2024-12-31 08:09:16 UTC Comment hidden (obsolete)
Comment 91 Emmi Takkinen 2024-12-31 08:09:48 UTC Comment hidden (obsolete)
Comment 92 Emmi Takkinen 2024-12-31 08:10:10 UTC Comment hidden (obsolete)
Comment 93 Emmi Takkinen 2024-12-31 08:10:40 UTC Comment hidden (obsolete)
Comment 94 Emmi Takkinen 2024-12-31 08:11:02 UTC Comment hidden (obsolete)
Comment 95 Emmi Takkinen 2024-12-31 08:11:27 UTC Comment hidden (obsolete)
Comment 96 Emmi Takkinen 2024-12-31 08:11:58 UTC Comment hidden (obsolete)
Comment 97 Emmi Takkinen 2024-12-31 08:12:21 UTC Comment hidden (obsolete)
Comment 98 Emmi Takkinen 2024-12-31 08:13:05 UTC
Tested and now filtering with status works as intended. Also tests pass.
Comment 99 Victor Grousset/tuxayo 2025-01-06 04:28:25 UTC
Comment on attachment 176023 [details] [review]
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items

Review of attachment 176023 [details] [review]:
-----------------------------------------------------------------

::: Koha/Item.pm
@@ +1469,5 @@
> +    if ( $self->damaged ) {
> +        push @statuses, 'damaged';
> +    }
> +    if ( $self->notforloan || $self->item_type->notforloan  ) {
> +        # TODO on a big Koha::Items loop we are going to join with item_type too often, use a cache

Is the concern big enough to at least have a ticket opened to measure this? And eventually implement a cache.

@@ +1487,5 @@
> +    if ( $self->restricted ) {
> +        push @statuses, 'restricted';
> +    }
> +
> +    # TODO in_bundle?

Was that meant to be temporary or does it have a long term use?
Does it warrant at least opening a follow-up ticket or it's too minor?
Does it warrant some manual testing related to bundles?
Comment 100 Lucas Gass (lukeg) 2025-01-06 14:45:01 UTC
(In reply to Victor Grousset/tuxayo from comment #99)
> Comment on attachment 176023 [details] [review] [review]
> Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items
> 
> Review of attachment 176023 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: Koha/Item.pm
> @@ +1469,5 @@
> > +    if ( $self->damaged ) {
> > +        push @statuses, 'damaged';
> > +    }
> > +    if ( $self->notforloan || $self->item_type->notforloan  ) {
> > +        # TODO on a big Koha::Items loop we are going to join with item_type too often, use a cache
> 
> Is the concern big enough to at least have a ticket opened to measure this?
> And eventually implement a cache.

Yes, we should open a new bug report for this.  


> @@ +1487,5 @@
> > +    if ( $self->restricted ) {
> > +        push @statuses, 'restricted';
> > +    }
> > +
> > +    # TODO in_bundle?
> 
> Was that meant to be temporary or does it have a long term use?
> Does it warrant at least opening a follow-up ticket or it's too minor?
> Does it warrant some manual testing related to bundles?

in_bundle is a status, so that needs to be included in this bug, I think. I will add ASAP.
Comment 101 Victor Grousset/tuxayo 2025-01-06 20:28:56 UTC
To pass the tests, only these two commits are needed:
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items
Bug 37334: Restore filtering holdings per status

Looking the diffs of the other commits, there are substantial changes that would have been expected to be necessary for tests to pass.

After that smoke test, let's look at proper coverage:
https://wiki.koha-community.org/wiki/Coding_Guidelines#PERL17:_Unit_tests_are_required


These are not covered by tests:
sub filter_by_has_recalls
sub filter_by_available

search() have very little coverage.
At least having the most complex case (not_for_loan) covered would be safer.
The "recalled" and "available" cases would also cover the above paragraph. Or maybe they should be tested directly and not via search(). No opinion on this.
Comment 102 Victor Grousset/tuxayo 2025-01-06 20:38:23 UTC
> Yes, we should open a new bug report for this.  

ok, I'm experimenting with hijacking the release notes field to keep track of this.


------


Thanks for the existing tests. coverage of _status is perfect and so is all the other filter_by_* subs.
Comment 103 Lucas Gass (lukeg) 2025-01-13 21:09:43 UTC Comment hidden (obsolete)
Comment 104 Lucas Gass (lukeg) 2025-01-13 21:33:08 UTC Comment hidden (obsolete)
Comment 105 Lucas Gass (lukeg) 2025-01-13 22:37:41 UTC Comment hidden (obsolete)
Comment 106 Lucas Gass (lukeg) 2025-01-13 23:29:12 UTC Comment hidden (obsolete)
Comment 107 Lucas Gass (lukeg) 2025-01-13 23:30:27 UTC
I have added the ability to filter by bundles w/ tests. I have also included tests for filter_by_has_recalls and filter_by_available

Resetting to 'Signed off'
Comment 108 Jonathan Druart 2025-01-16 15:02:43 UTC
*** Bug 38686 has been marked as a duplicate of this bug. ***
Comment 109 Victor Grousset/tuxayo 2025-01-29 18:12:22 UTC
(In reply to Victor Grousset/tuxayo from comment #101)
> These are not covered by tests:
> sub filter_by_has_recalls
> sub filter_by_available

All good, thanks :)

> search() have very little coverage.
> At least having the most complex case (not_for_loan) covered would be safer.
> The "recalled" and "available" cases would also cover the above paragraph.
> Or maybe they should be tested directly and not via search(). No opinion on
> this.

Still the same issue with search() unfortunately.
Comment 110 Lucas Gass (lukeg) 2025-01-29 21:41:01 UTC Comment hidden (obsolete)
Comment 111 Caroline Cyr La Rose 2025-01-31 20:45:11 UTC
There aren't any test plans that I can see on here... I tried applying the patches and using the search box at the top of the holdings table to search for statuses and it doesn't find anything. Is that what this is trying to solve?

To recreate:
1. Go to a record details page (e.g. http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=285)

2. Add a couple of items with different statuses (or change the status of a couple of items)
   2.1. Click New > New item
   2.2. Change the Not for loan status to Staff collection (or another not for loan status)
   2.3. Click Add item
   2.4. Repeat 2.2 and 2.3 for various not for loan statuses
   2.5. Click Normal to go back to the record details page

3. Try to search for the status in the holdings
   3.1. Using the small search box right above the holdings table, search for one of the statuses (e.g. "Staff")
   --> No results
Comment 112 Lucas Gass (lukeg) 2025-01-31 21:51:12 UTC Comment hidden (obsolete)
Comment 113 Lucas Gass (lukeg) 2025-01-31 21:51:17 UTC Comment hidden (obsolete)
Comment 114 Lucas Gass (lukeg) 2025-01-31 21:51:21 UTC Comment hidden (obsolete)
Comment 115 Lucas Gass (lukeg) 2025-01-31 21:51:25 UTC Comment hidden (obsolete)
Comment 116 Lucas Gass (lukeg) 2025-01-31 21:51:29 UTC Comment hidden (obsolete)
Comment 117 Lucas Gass (lukeg) 2025-01-31 21:51:34 UTC Comment hidden (obsolete)
Comment 118 Lucas Gass (lukeg) 2025-01-31 21:51:38 UTC Comment hidden (obsolete)
Comment 119 Lucas Gass (lukeg) 2025-01-31 21:51:42 UTC Comment hidden (obsolete)
Comment 120 Lucas Gass (lukeg) 2025-01-31 21:51:45 UTC Comment hidden (obsolete)
Comment 121 Lucas Gass (lukeg) 2025-01-31 21:51:50 UTC Comment hidden (obsolete)
Comment 122 Lucas Gass (lukeg) 2025-01-31 21:51:54 UTC Comment hidden (obsolete)
Comment 123 Lucas Gass (lukeg) 2025-01-31 21:51:59 UTC Comment hidden (obsolete)
Comment 124 Lucas Gass (lukeg) 2025-01-31 21:52:03 UTC Comment hidden (obsolete)
Comment 125 Lucas Gass (lukeg) 2025-01-31 21:52:07 UTC Comment hidden (obsolete)
Comment 126 Lucas Gass (lukeg) 2025-01-31 21:52:11 UTC Comment hidden (obsolete)
Comment 127 Lucas Gass (lukeg) 2025-01-31 21:52:15 UTC Comment hidden (obsolete)
Comment 128 Lucas Gass (lukeg) 2025-01-31 21:52:19 UTC Comment hidden (obsolete)
Comment 129 Lucas Gass (lukeg) 2025-01-31 21:52:23 UTC Comment hidden (obsolete)
Comment 130 Lucas Gass (lukeg) 2025-01-31 21:53:30 UTC
(In reply to Caroline Cyr La Rose from comment #111)
> There aren't any test plans that I can see on here... I tried applying the
> patches and using the search box at the top of the holdings table to search
> for statuses and it doesn't find anything. Is that what this is trying to
> solve?

I attached a test plan to the first commit.
Comment 131 Victor Grousset/tuxayo 2025-02-02 23:10:41 UTC
For testing, one needs to run `yarn api:bundle` after applying the patch and before restarting the services.
Otherwise there is an error 400 when loading the record page.
Comment 132 Emmi Takkinen 2025-02-03 09:45:59 UTC
Tested again with all statuses mentioned in test plan. Following statuses were filtered ok:

- DAMAGED
- WITHDRAWN
- NOTFORLOAN
- RESTRICTED
- LOST
- CHECKEDOUT ok
- ON-SITE CHECKOUT
- ON HOLD (tested when item is just in hold and when it's waiting) 
- IN BUNDLE

These statuses still have problems:

- AVAILABLE (returns nothing)
- IN TRANSIT (returns available, notforloan, checkedout statuses)
- RECALLED (returns all items)

However tests in t/db_dependent/Koha/Items.t all pass.
Comment 133 Emmi Takkinen 2025-02-03 11:11:02 UTC
There's most likely something wrong with filter_by_in_transit and filter_by_has_recalls. Commenting them from filter_by_available fixes filtering for available status.

In filter_by_has_recalls there is a wrong column name where itemnumbers are searched from. It should be item_id, not itemnumber:

 my $recalls = Koha::Recalls->search(
    { %$params, 'me.item_id' => [ $self->get_column('itemnumber') ], 'me.item_level' => 1,  },
        {
            columns  => ['item_id'],
            distinct => 1
        }
)->_resultset->as_query;

In filter_by_in_transit columns are ok, so I'm not sure what's wrong with it.
Comment 134 Emmi Takkinen 2025-02-03 11:38:37 UTC
It seems that filter_by_in_transit returns every item that has row in branchtransfers table even if item is not currently in transit. E.g. it returned item from my database which was last time transferred 2021.
Comment 135 Jonathan Druart 2025-02-03 11:46:24 UTC
(In reply to Emmi Takkinen from comment #132)

> - AVAILABLE (returns nothing)
> - IN TRANSIT (returns available, notforloan, checkedout statuses)

I've only tried this:
https://snipboard.io/oiQlTF.jpg
https://snipboard.io/o9PfTv.jpg
https://snipboard.io/tZgc0x.jpg

Can you provide more detail please?
Comment 136 Jonathan Druart 2025-02-03 11:49:00 UTC
ok, forget my comment. Your previous comment answered it.
Comment 137 Jonathan Druart 2025-02-03 11:51:58 UTC Comment hidden (obsolete)
Comment 138 Victor Grousset/tuxayo 2025-02-04 18:59:26 UTC
When having a restricted item ($5), the item table loads indefinitely. And console says:
TypeError: row.bundle_host is null

Line is:
                        if ( status == 'restricted') {
                            nodes += '<span class="bundled">%s</span>'.format(_("In bundle: %s").format($biblio_to_html(row.bundle_host.biblio, { link: true })));
                        }


Going back to main + yarn api:bundle ; restart_all + force refresh makes the table work. And with the patches the error happens again.
Comment 139 Lucas Gass (lukeg) 2025-02-04 20:09:45 UTC
(In reply to Victor Grousset/tuxayo from comment #138)
> When having a restricted item ($5), the item table loads indefinitely. And
> console says:
> TypeError: row.bundle_host is null
> 
> Line is:
>                         if ( status == 'restricted') {
>                             nodes += '<span
> class="bundled">%s</span>'.format(_("In bundle:
> %s").format($biblio_to_html(row.bundle_host.biblio, { link: true })));
>                         }
> 
> 
> Going back to main + yarn api:bundle ; restart_all + force refresh makes the
> table work. And with the patches the error happens again.

That looks like a bad copy/paste.
Comment 140 Lucas Gass (lukeg) 2025-02-04 20:10:37 UTC Comment hidden (obsolete)
Comment 141 Lucas Gass (lukeg) 2025-02-04 23:10:51 UTC Comment hidden (obsolete)
Comment 142 Emmi Takkinen 2025-02-05 06:25:28 UTC Comment hidden (obsolete)
Comment 143 Emmi Takkinen 2025-02-05 06:26:09 UTC Comment hidden (obsolete)
Comment 144 Emmi Takkinen 2025-02-05 06:26:46 UTC Comment hidden (obsolete)
Comment 145 Emmi Takkinen 2025-02-05 06:27:24 UTC Comment hidden (obsolete)
Comment 146 Emmi Takkinen 2025-02-05 06:27:57 UTC Comment hidden (obsolete)
Comment 147 Emmi Takkinen 2025-02-05 06:28:29 UTC Comment hidden (obsolete)
Comment 148 Emmi Takkinen 2025-02-05 06:28:59 UTC Comment hidden (obsolete)
Comment 149 Emmi Takkinen 2025-02-05 06:29:28 UTC Comment hidden (obsolete)
Comment 150 Emmi Takkinen 2025-02-05 06:30:23 UTC
Tested again and all seems to be working as expected.
Comment 151 Lucas Gass (lukeg) 2025-02-05 14:56:21 UTC
(In reply to Emmi Takkinen from comment #150)
> Tested again and all seems to be working as expected.

Thank you, Emmi!
Comment 152 Lucas Gass (lukeg) 2025-02-11 20:45:07 UTC Comment hidden (obsolete)
Comment 153 Lucas Gass (lukeg) 2025-02-11 20:45:14 UTC Comment hidden (obsolete)
Comment 154 Lucas Gass (lukeg) 2025-02-11 20:45:18 UTC Comment hidden (obsolete)
Comment 155 Lucas Gass (lukeg) 2025-02-11 20:45:22 UTC Comment hidden (obsolete)
Comment 156 Lucas Gass (lukeg) 2025-02-11 20:45:27 UTC Comment hidden (obsolete)
Comment 157 Lucas Gass (lukeg) 2025-02-11 20:45:31 UTC Comment hidden (obsolete)
Comment 158 Lucas Gass (lukeg) 2025-02-11 20:45:36 UTC Comment hidden (obsolete)
Comment 159 Lucas Gass (lukeg) 2025-02-11 20:45:40 UTC Comment hidden (obsolete)
Comment 160 Lucas Gass (lukeg) 2025-02-11 20:45:45 UTC Comment hidden (obsolete)
Comment 161 Lucas Gass (lukeg) 2025-02-11 20:45:49 UTC Comment hidden (obsolete)
Comment 162 Lucas Gass (lukeg) 2025-02-11 20:45:53 UTC Comment hidden (obsolete)
Comment 163 Lucas Gass (lukeg) 2025-02-11 20:45:57 UTC Comment hidden (obsolete)
Comment 164 Lucas Gass (lukeg) 2025-02-11 20:46:01 UTC Comment hidden (obsolete)
Comment 165 Lucas Gass (lukeg) 2025-02-11 20:46:05 UTC Comment hidden (obsolete)
Comment 166 Lucas Gass (lukeg) 2025-02-11 20:46:09 UTC Comment hidden (obsolete)
Comment 167 Lucas Gass (lukeg) 2025-02-11 20:46:14 UTC Comment hidden (obsolete)
Comment 168 Lucas Gass (lukeg) 2025-02-11 20:46:18 UTC Comment hidden (obsolete)
Comment 169 Lucas Gass (lukeg) 2025-02-11 20:46:22 UTC Comment hidden (obsolete)
Comment 170 Lucas Gass (lukeg) 2025-02-11 20:46:26 UTC Comment hidden (obsolete)
Comment 171 Lucas Gass (lukeg) 2025-02-11 20:46:31 UTC Comment hidden (obsolete)
Comment 172 Lucas Gass (lukeg) 2025-02-24 18:45:56 UTC Comment hidden (obsolete)
Comment 173 Lucas Gass (lukeg) 2025-02-24 18:46:00 UTC Comment hidden (obsolete)
Comment 174 Lucas Gass (lukeg) 2025-02-24 18:46:05 UTC Comment hidden (obsolete)
Comment 175 Lucas Gass (lukeg) 2025-02-24 18:46:09 UTC Comment hidden (obsolete)
Comment 176 Lucas Gass (lukeg) 2025-02-24 18:46:14 UTC Comment hidden (obsolete)
Comment 177 Lucas Gass (lukeg) 2025-02-24 18:46:18 UTC Comment hidden (obsolete)
Comment 178 Lucas Gass (lukeg) 2025-02-24 18:46:22 UTC Comment hidden (obsolete)
Comment 179 Lucas Gass (lukeg) 2025-02-24 18:46:27 UTC Comment hidden (obsolete)
Comment 180 Lucas Gass (lukeg) 2025-02-24 18:46:31 UTC Comment hidden (obsolete)
Comment 181 Lucas Gass (lukeg) 2025-02-24 18:46:36 UTC Comment hidden (obsolete)
Comment 182 Lucas Gass (lukeg) 2025-02-24 18:46:40 UTC Comment hidden (obsolete)
Comment 183 Lucas Gass (lukeg) 2025-02-24 18:46:44 UTC Comment hidden (obsolete)
Comment 184 Lucas Gass (lukeg) 2025-02-24 18:46:49 UTC Comment hidden (obsolete)
Comment 185 Lucas Gass (lukeg) 2025-02-24 18:46:53 UTC Comment hidden (obsolete)
Comment 186 Lucas Gass (lukeg) 2025-02-24 18:46:58 UTC Comment hidden (obsolete)
Comment 187 Lucas Gass (lukeg) 2025-02-24 18:47:02 UTC Comment hidden (obsolete)
Comment 188 Lucas Gass (lukeg) 2025-02-24 18:47:07 UTC Comment hidden (obsolete)
Comment 189 Lucas Gass (lukeg) 2025-02-24 18:47:11 UTC Comment hidden (obsolete)
Comment 190 Lucas Gass (lukeg) 2025-02-24 18:48:49 UTC
Rebased for current main again
Comment 191 Lucas Gass (lukeg) 2025-03-31 14:43:14 UTC Comment hidden (obsolete)
Comment 192 Lucas Gass (lukeg) 2025-04-01 12:42:26 UTC Comment hidden (obsolete)
Comment 193 Lucas Gass (lukeg) 2025-04-01 12:42:30 UTC Comment hidden (obsolete)
Comment 194 Lucas Gass (lukeg) 2025-04-01 12:42:34 UTC Comment hidden (obsolete)
Comment 195 Lucas Gass (lukeg) 2025-04-01 12:42:38 UTC Comment hidden (obsolete)
Comment 196 Lucas Gass (lukeg) 2025-04-01 12:42:43 UTC Comment hidden (obsolete)
Comment 197 Lucas Gass (lukeg) 2025-04-01 12:42:47 UTC Comment hidden (obsolete)
Comment 198 Lucas Gass (lukeg) 2025-04-01 12:42:51 UTC Comment hidden (obsolete)
Comment 199 Lucas Gass (lukeg) 2025-04-01 12:42:55 UTC Comment hidden (obsolete)
Comment 200 Lucas Gass (lukeg) 2025-04-01 12:42:59 UTC Comment hidden (obsolete)
Comment 201 Lucas Gass (lukeg) 2025-04-01 12:43:03 UTC Comment hidden (obsolete)
Comment 202 Lucas Gass (lukeg) 2025-04-01 12:43:07 UTC Comment hidden (obsolete)
Comment 203 Lucas Gass (lukeg) 2025-04-01 12:43:11 UTC Comment hidden (obsolete)
Comment 204 Lucas Gass (lukeg) 2025-04-01 12:43:15 UTC Comment hidden (obsolete)
Comment 205 Lucas Gass (lukeg) 2025-04-01 12:43:20 UTC Comment hidden (obsolete)
Comment 206 Lucas Gass (lukeg) 2025-04-01 12:43:24 UTC Comment hidden (obsolete)
Comment 207 Lucas Gass (lukeg) 2025-04-01 12:43:28 UTC Comment hidden (obsolete)
Comment 208 Lucas Gass (lukeg) 2025-04-01 12:43:33 UTC Comment hidden (obsolete)
Comment 209 Lucas Gass (lukeg) 2025-04-01 12:43:37 UTC Comment hidden (obsolete)
Comment 210 Lucas Gass (lukeg) 2025-04-01 12:43:42 UTC Comment hidden (obsolete)
Comment 211 Lucas Gass (lukeg) 2025-04-01 13:59:45 UTC Comment hidden (obsolete)
Comment 212 Lucas Gass (lukeg) 2025-04-18 14:31:24 UTC Comment hidden (obsolete)
Comment 213 Lucas Gass (lukeg) 2025-04-18 14:31:28 UTC Comment hidden (obsolete)
Comment 214 Lucas Gass (lukeg) 2025-04-18 14:31:32 UTC Comment hidden (obsolete)
Comment 215 Lucas Gass (lukeg) 2025-04-18 14:31:36 UTC Comment hidden (obsolete)
Comment 216 Lucas Gass (lukeg) 2025-04-18 14:31:40 UTC Comment hidden (obsolete)
Comment 217 Lucas Gass (lukeg) 2025-04-18 14:31:44 UTC Comment hidden (obsolete)
Comment 218 Lucas Gass (lukeg) 2025-04-18 14:31:48 UTC Comment hidden (obsolete)
Comment 219 Lucas Gass (lukeg) 2025-04-18 14:31:53 UTC Comment hidden (obsolete)
Comment 220 Lucas Gass (lukeg) 2025-04-18 14:31:57 UTC Comment hidden (obsolete)
Comment 221 Lucas Gass (lukeg) 2025-04-18 14:32:01 UTC Comment hidden (obsolete)
Comment 222 Lucas Gass (lukeg) 2025-04-18 14:32:05 UTC Comment hidden (obsolete)
Comment 223 Lucas Gass (lukeg) 2025-04-18 14:32:10 UTC Comment hidden (obsolete)
Comment 224 Lucas Gass (lukeg) 2025-04-18 14:32:14 UTC Comment hidden (obsolete)
Comment 225 Lucas Gass (lukeg) 2025-04-18 14:32:18 UTC Comment hidden (obsolete)
Comment 226 Lucas Gass (lukeg) 2025-04-18 14:32:22 UTC Comment hidden (obsolete)
Comment 227 Lucas Gass (lukeg) 2025-04-18 14:32:26 UTC Comment hidden (obsolete)
Comment 228 Lucas Gass (lukeg) 2025-04-18 14:32:30 UTC Comment hidden (obsolete)
Comment 229 Lucas Gass (lukeg) 2025-04-18 14:32:34 UTC Comment hidden (obsolete)
Comment 230 Lucas Gass (lukeg) 2025-04-18 14:32:38 UTC Comment hidden (obsolete)
Comment 231 Lucas Gass (lukeg) 2025-04-18 14:32:42 UTC Comment hidden (obsolete)
Comment 232 Lucas Gass (lukeg) 2025-04-18 14:33:26 UTC
Rebased again for current main
Comment 233 Caroline Cyr La Rose 2025-04-25 20:26:29 UTC
Hi Lucas! I was testing this and ran into a problem when I added an item with a Restricted access status.

1. WITHOUT applying the patch, go to a record (e.g. http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=285)
2. Click New > New item
3. Under 5 - Use restrictions, choose Restricted Access
4. Click Add item
5. Click Normal
   --> Record and items appear OK

6. Apply patch
7. In ktd --shell, do yarn api:bundle
8. Then reset_all
9. Redo steps 1-5
   --> Record appears, but items are "processing" forever
Comment 234 Jonathan Druart 2025-04-28 08:03:27 UTC
Confirmed.

Nice one, Caroline.

There is a JS error in the console: Uncaught TypeError: row.bundle_host is null
Comment 235 Lucas Gass (lukeg) 2025-04-28 17:04:01 UTC
Created attachment 181632 [details] [review]
Bug 37334: Correct logic for filtering by in_bundle
Comment 236 Lucas Gass (lukeg) 2025-04-28 17:04:53 UTC
(In reply to Caroline Cyr La Rose from comment #233)
> Hi Lucas! I was testing this and ran into a problem when I added an item
> with a Restricted access status.
> 
> 1. WITHOUT applying the patch, go to a record (e.g.
> http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=285)
> 2. Click New > New item
> 3. Under 5 - Use restrictions, choose Restricted Access
> 4. Click Add item
> 5. Click Normal
>    --> Record and items appear OK
> 
> 6. Apply patch
> 7. In ktd --shell, do yarn api:bundle
> 8. Then reset_all
> 9. Redo steps 1-5
>    --> Record appears, but items are "processing" forever

Thanks Caroline! That should be fixed now!
Comment 237 Jonathan Druart 2025-05-13 12:51:19 UTC
Created attachment 182359 [details] [review]
Bug 37334: Allow embed _status for GET /biblio/{biblio_id}/items

To test;

0. APPLY PATCH, restart_all
1. Go to a record details page (e.g. http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=285)
2. Click the 'Show filters' button above the table
3. Now, at the top of the Status column you should see a dropdown to filter by status
4. You'll have to create several item status to test everything.

5. Add some new items/or change some item status to: DAMAGED, WITHDRAWN, NOTFORLOAN, RESTRICTED, and LOST
6. Test the status filter for each of these statuses, ensuring the work correctly.
7. Create more new items and have some that are checked out, ensure that filter works
8. Put some items into transit and make sure the 'In transit' filter works
9. Put some items on hold, both item and bib level. Make sure the 'On hold' filter works.
10. Turn on the USERecalls system preference and make some recalls, both item and bib level. Make sure the 'Recalled' filter works
11. Create some bundles, make sure the 'In bundle' status works.
12. Also make sure that the available filter is working.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Bug 37334: Correct logic for filtering by in_bundle

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 238 Jonathan Druart 2025-05-13 12:51:25 UTC
Created attachment 182360 [details] [review]
Bug 37334: Allow a column filter to be shown even searchable is off

We do not want to use the usual filtering method here, we are building
the query from "additional filters"

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 239 Jonathan Druart 2025-05-13 12:51:32 UTC
Created attachment 182361 [details] [review]
Bug 37334: Restore filtering holdings per status

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Bug 37334: Fix column offset

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 240 Jonathan Druart 2025-05-13 12:51:38 UTC
Created attachment 182362 [details] [review]
Bug 37334: Fix logic for not available

Several major changes here:
* the push @not_availab_itemnumbers for lost, damaged, etc. was totally
  wrong
* not for loan is only for positive values
* restricted can be NULL

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 241 Jonathan Druart 2025-05-13 12:51:44 UTC
Created attachment 182363 [details] [review]
Bug 37334: Fix restricted and notforloan filter logic

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 242 Jonathan Druart 2025-05-13 12:51:49 UTC
Created attachment 182364 [details] [review]
Bug 37334: Return all non zero notforloan statuses

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 243 Jonathan Druart 2025-05-13 12:51:54 UTC
Created attachment 182365 [details] [review]
Bug 37334: filter_by_available should not return notforloan statues other than 0

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 244 Jonathan Druart 2025-05-13 12:51:59 UTC
Created attachment 182366 [details] [review]
Bug 37334: Add _status tests

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 245 Jonathan Druart 2025-05-13 12:52:04 UTC
Created attachment 182367 [details] [review]
Bug 37334: Add filter_by_checked_out tests

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 246 Jonathan Druart 2025-05-13 12:52:10 UTC
Created attachment 182368 [details] [review]
Bug 37334: Add POD

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 247 Jonathan Druart 2025-05-13 12:52:15 UTC
Created attachment 182369 [details] [review]
Bug 37334: Add filter_by_in_transit tests

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 248 Jonathan Druart 2025-05-13 12:52:21 UTC
Created attachment 182370 [details] [review]
Bug 37334: Add filter_by_has_holds tests

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 249 Jonathan Druart 2025-05-13 12:52:26 UTC
Created attachment 182371 [details] [review]
Bug 37334: Fix filter_by_has_recalls

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 250 Jonathan Druart 2025-05-13 12:52:31 UTC
Created attachment 182372 [details] [review]
Bug 37334: Add ability to filter by in_bundle

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 251 Jonathan Druart 2025-05-13 12:52:36 UTC
Created attachment 182373 [details] [review]
Bug 37334: filter_by_in_bundle tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 252 Jonathan Druart 2025-05-13 12:52:41 UTC
Created attachment 182374 [details] [review]
Bug 37334: Add filter_by_recall test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 253 Jonathan Druart 2025-05-13 12:52:46 UTC
Created attachment 182375 [details] [review]
Bug 37334: Add filter_by_available tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 254 Jonathan Druart 2025-05-13 12:52:52 UTC
Created attachment 182376 [details] [review]
Bug 37334: Add search tests

Bug 37334: Adjust number of tests in Items.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 255 Jonathan Druart 2025-05-13 12:53:27 UTC
I've merged the last 3 patches into the other patches, where they belong.
Comment 256 Katrin Fischer 2025-05-15 06:35:46 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 257 Katrin Fischer 2025-05-15 11:09:36 UTC
I am sorry, but this needs some more work for the tests to pass (see dashboard main/D12)

AssertionError: Timed out retrying after 10000ms: Expected to find content: 'Status' within the element: <th#holdings_actions.no-sort.no-export.actions.dt-orderable-none> but never did.
    at Context.eval (webpack://koha/./t/cypress/integration/KohaTable/Holdings_spec.ts
Comment 258 Lucas Gass (lukeg) 2025-05-16 15:44:55 UTC
(In reply to Katrin Fischer from comment #257)
> I am sorry, but this needs some more work for the tests to pass (see
> dashboard main/D12)
> 
> AssertionError: Timed out retrying after 10000ms: Expected to find content:
> 'Status' within the element:
> <th#holdings_actions.no-sort.no-export.actions.dt-orderable-none> but never
> did.
>     at Context.eval
> (webpack://koha/./t/cypress/integration/KohaTable/Holdings_spec.ts

I am working on these tests and have asked Tomas for some help.
Comment 259 Lucas Gass (lukeg) 2025-05-16 19:55:54 UTC
Created attachment 182552 [details] [review]
Bug 37334: Update Holdings_spec.ts test
Comment 260 Tomás Cohen Arazi (tcohen) 2025-05-17 12:18:25 UTC
Follow-up pushed to main, for 25.05. Thanks Lucas!
Comment 261 Tomás Cohen Arazi (tcohen) 2025-05-20 00:07:29 UTC
I don't manage to make this work.

Whenever I use the filter, I see it reaches `Koha::Items->search` with this form: `^lost$` so the `eq` never matches.
Comment 262 Tomás Cohen Arazi (tcohen) 2025-05-20 00:08:26 UTC
(In reply to Tomás Cohen Arazi (tcohen) from comment #261)
> I don't manage to make this work.
> 
> Whenever I use the filter, I see it reaches `Koha::Items->search` with this
> form: `^lost$` so the `eq` never matches.

Sorry, maybe it is because I'm on top of bug 39932. But I think it needs to be fixed on top of it for the release.
Comment 263 Jonathan Druart 2025-05-20 12:24:24 UTC
(In reply to Tomás Cohen Arazi (tcohen) from comment #262)
> (In reply to Tomás Cohen Arazi (tcohen) from comment #261)
> > I don't manage to make this work.
> > 
> > Whenever I use the filter, I see it reaches `Koha::Items->search` with this
> > form: `^lost$` so the `eq` never matches.

I think it's because of bug 39473.
Comment 264 Jonathan Druart 2025-05-20 12:30:33 UTC
Created attachment 182665 [details] [review]
Bug 37334: Fix conflict with bug 39473

Bug 39473 added ^ and $ to options of the dropdown lists from the
column filters.

They are removed and replaced with "exact" later in the code (using
build_query).

But in the case of "_status", we do no get this code as it's not a
regular column (it does not have "data" attribute), but an additional
filters.

I don't think this fix is ideal, but we are too close to the release to
rework datatables.js
Comment 265 Katrin Fischer 2025-05-22 13:09:02 UTC
Can someone take a look at the failing tests please? I need fixes urgently as we are so close to release now:

Show filters.catalogue/detail/holdings_table Show filters
Correctly init the table.catalogue/detail/holdings_table Correctly init the table
Comment 266 Jonathan Druart 2025-05-22 13:35:33 UTC
(In reply to Katrin Fischer from comment #265)
> Can someone take a look at the failing tests please? I need fixes urgently
> as we are so close to release now:
> 
> Show filters.catalogue/detail/holdings_table Show filters
> Correctly init the table.catalogue/detail/holdings_table Correctly init the
> table

18:40:04 koha_1       |   &gt; row._status.forEach is not a function

This is because of bug 39932
Comment 267 Tomás Cohen Arazi (tcohen) 2025-05-22 13:52:35 UTC
Created attachment 182733 [details] [review]
Bug 37334: Adjust mocked _status data (bug 39932 follow-up)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 268 Tomás Cohen Arazi (tcohen) 2025-05-22 14:25:18 UTC
(In reply to Tomás Cohen Arazi (tcohen) from comment #267)
> Created attachment 182733 [details] [review] [review]
> Bug 37334: Adjust mocked _status data (bug 39932 follow-up)
> 
> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Pushed to main.
Comment 269 Andrii Nugged 2025-05-26 15:30:04 UTC
In:
koha-tmpl/intranet-tmpl/prog/js/datatables.js
now we have this:
                    } else if (v) {
                        additional_filters[k] = v
                            .replace(/^\^/, "")
                            .replace(/\$$/, "");
                    }

But when we search by a single letter, in v we have object: {like: 'A%'}, that's not a string and doesn't have .replace, so the browser crashes.
Comment 270 Emmi Takkinen 2025-05-27 05:43:17 UTC
(In reply to Andrii Nugged from comment #269)
> In:
> koha-tmpl/intranet-tmpl/prog/js/datatables.js
> now we have this:
>                     } else if (v) {
>                         additional_filters[k] = v
>                             .replace(/^\^/, "")
>                             .replace(/\$$/, "");
>                     }
> 
> But when we search by a single letter, in v we have object: {like: 'A%'},
> that's not a string and doesn't have .replace, so the browser crashes.

This is causing problems also with modify holds tool which I'm working on (bug 36135). When I try to search holds with it, following error is displayed in browsers console:

>Uncaught TypeError: v.replace is not a function
Comment 271 Emmi Takkinen 2025-05-27 07:07:31 UTC
(In reply to Emmi Takkinen from comment #270)
> (In reply to Andrii Nugged from comment #269)
> > In:
> > koha-tmpl/intranet-tmpl/prog/js/datatables.js
> > now we have this:
> >                     } else if (v) {
> >                         additional_filters[k] = v
> >                             .replace(/^\^/, "")
> >                             .replace(/\$$/, "");
> >                     }
> > 
> > But when we search by a single letter, in v we have object: {like: 'A%'},
> > that's not a string and doesn't have .replace, so the browser crashes.
> 
> This is causing problems also with modify holds tool which I'm working on
> (bug 36135). When I try to search holds with it, following error is
> displayed in browsers console:
> 
> >Uncaught TypeError: v.replace is not a function

Patron search and records holding table are broken due this.
Comment 272 Jonathan Druart 2025-05-27 08:06:08 UTC
Andrii, Emmi: I've opened bug 37334, I am on it.