Bug 34823 - Do not show item group drop-down if there are no item groups
Summary: Do not show item group drop-down if there are no item groups
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low trivial (vote)
Assignee: Lucas Gass
QA Contact: Emily Lamancusa
URL:
Keywords:
Depends on: 36227
Blocks:
  Show dependency treegraph
 
Reported: 2023-09-18 18:08 UTC by Caroline Cyr La Rose
Modified: 2024-05-30 19:23 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06,23.05.12


Attachments
Bug 34823: Do not show Item group dropdown if there are no item groups (1.89 KB, patch)
2024-03-06 18:42 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 34823: Do not show Item group dropdown if there are no item groups (1.96 KB, patch)
2024-03-06 19:03 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 34823: Do not show Item group dropdown if there are no item groups (2.03 KB, patch)
2024-05-10 20:46 UTC, Emily Lamancusa
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2023-09-18 18:08:02 UTC
When EnableItemGroupHolds is activated, there is a "Request specific item group:" drop-down in the OPAC when placing a hold. However, this drop-down appears regardless of whether the record has item groups or not. I think this may be confusing for patrons.

To replicate:
1. Enable EnableItemGroups and EnableItemGroupHolds
2. Go to the OPAC and log in as a patron
3. Go to any record that doesn't have grouped items and try to place a hold
4. Click on "Show more options"
--> Note that there is an option to choose an item group with the only option being "Any item group"
Comment 1 Lucas Gass 2024-03-06 18:42:45 UTC
Created attachment 162847 [details] [review]
Bug 34823: Do not show Item group dropdown if there are no item groups

To test:
1. Enable EnableItemGroups and EnableItemGroupHolds
2. Go to the OPAC and log in as a patron
3. Go to any record that doesn't have grouped items and try to place a hold
4. Click on "Show more options"
5. See "Request specific item group:" and dropdown
6. APPLY PATCH
7. Try again, this time if the record has no item groups you should not see the dropdown at all.
Comment 2 Caroline Cyr La Rose 2024-03-06 19:03:04 UTC
Created attachment 162850 [details] [review]
Bug 34823: Do not show Item group dropdown if there are no item groups

To test:
1. Enable EnableItemGroups and EnableItemGroupHolds
2. Go to the OPAC and log in as a patron
3. Go to any record that doesn't have grouped items and try to place a hold
4. Click on "Show more options"
5. See "Request specific item group:" and dropdown
6. APPLY PATCH
7. Try again, this time if the record has no item groups you should not see the dropdown at all.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Caroline Cyr La Rose 2024-03-06 19:03:25 UTC
Thanks Lucas!
Comment 4 Emily Lamancusa 2024-03-27 17:20:59 UTC
Moving this to BLOCKED for now, since the dependent patch does not apply.
Comment 5 Emily Lamancusa 2024-03-27 19:55:40 UTC
There's also an edge case when a record has item groups defined, but all of the item groups are empty. Could this fix be adjusted to cover that case too? Maybe by filtering the search itself to exclude empty item groups, and bumping it up in the code a bit?
Comment 6 Lucas Gass 2024-03-27 20:04:02 UTC
(In reply to Emily Lamancusa from comment #5)
> There's also an edge case when a record has item groups defined, but all of
> the item groups are empty. Could this fix be adjusted to cover that case
> too? Maybe by filtering the search itself to exclude empty item groups, and
> bumping it up in the code a bit?

I must be missing something because I thought that is what this patch is correcting.
Comment 7 Emily Lamancusa 2024-04-01 18:22:32 UTC
(In reply to Lucas Gass from comment #6)
> (In reply to Emily Lamancusa from comment #5)
> > There's also an edge case when a record has item groups defined, but all of
> > the item groups are empty. Could this fix be adjusted to cover that case
> > too? Maybe by filtering the search itself to exclude empty item groups, and
> > bumping it up in the code a bit?
> 
> I must be missing something because I thought that is what this patch is
> correcting.

It corrects the usual case, where a record has no item groups at all. To replicate what I'm seeing:
1. Apply the patch
2. On the intranet, find a record with no item groups
3. Add one or more item groups to that record
   (Do not add any items to the item group(s))
4. On the OPAC, go to that record and try to place a hold
--> Note that there is an option to choose an item group with the only option being "Any item group"

I can't think of a reason this state would exist except in error, so if this is not as easy to address as I'm imagining, then I don't think it needs to be a blocker. But if this case can be covered by making something like a three-line change as opposed to a one-line change, then I'd rather go with the more robust fix the first time around.
Comment 8 Emily Lamancusa 2024-05-10 20:46:29 UTC
Created attachment 166610 [details] [review]
Bug 34823: Do not show Item group dropdown if there are no item groups

To test:
1. Enable EnableItemGroups and EnableItemGroupHolds
2. Go to the OPAC and log in as a patron
3. Go to any record that doesn't have grouped items and try to place a hold
4. Click on "Show more options"
5. See "Request specific item group:" and dropdown
6. APPLY PATCH
7. Try again, this time if the record has no item groups you should not see the dropdown at all.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 9 Katrin Fischer 2024-05-13 12:02:17 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 10 Fridolin Somers 2024-05-29 12:25:37 UTC
Pushed to 23.11.x for 23.11.06
Comment 11 Lucas Gass 2024-05-30 19:23:31 UTC
Backported to 23.05.x for upcoming 23.05.12