Bug 38240

Summary: Filtering resulting in no result will hide filters
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Staff interfaceAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, gmcharlt, lucas, pedro.amorim, phil
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06
Circulation function:
Bug Depends on: 38118    
Bug Blocks: 33484    
Attachments: Bug 38240: Do not hide columns if no items to display
Bug 38240: Do not hide columns if no items to display
Bug 38240: Do not hide columns if no items to display
Bug 38240: Do not hide columns if no items to display

Description Jonathan Druart 2024-10-23 13:34:04 UTC
If you filter items using the column filters and that no item are displayed, all columns will be hidden (because no data for those columns) and it is then impossible to reset the filters show items again.
Comment 1 Jonathan Druart 2024-10-23 13:37:38 UTC
Created attachment 173217 [details] [review]
Bug 38240: Do not hide columns if no items to display

If you filter items using the column filters and that no item are displayed, all columns will be hidden (because no data for those columns) and it is then impossible to reset the filters show items again.

Test plan:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4
All items are from CPL
Select another library
=> No items displayed
Without this patch the headers are hidden and it's impossible to modify
the filters
With this patch the columns that were displayed on the last draw are
still there, letting you modify the filters

Of course there might have other problematic situations.
Say you have a lot of items, and you filter on a column that will lead
to display some items without data for this column, the filter will be
hidden and there will be no way to show it again.
Comment 2 Pedro Amorim 2024-10-23 14:55:30 UTC
Created attachment 173223 [details] [review]
Bug 38240: Do not hide columns if no items to display

If you filter items using the column filters and that no item are displayed, all columns will be hidden (because no data for those columns) and it is then impossible to reset the filters show items again.

Test plan:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4
All items are from CPL
Select another library
=> No items displayed
Without this patch the headers are hidden and it's impossible to modify
the filters
With this patch the columns that were displayed on the last draw are
still there, letting you modify the filters

Of course there might have other problematic situations.
Say you have a lot of items, and you filter on a column that will lead
to display some items without data for this column, the filter will be
hidden and there will be no way to show it again.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 3 Pedro Amorim 2024-10-23 14:57:18 UTC
(In reply to Jonathan Druart from comment #1)
> Of course there might have other problematic situations.
> Say you have a lot of items, and you filter on a column that will lead
> to display some items without data for this column, the filter will be
> hidden and there will be no way to show it again.

Are you able to provide instructions to reproduce this?
Comment 4 Phil Ringnalda 2024-10-24 02:33:27 UTC
Created attachment 173246 [details] [review]
Bug 38240: Do not hide columns if no items to display

If you filter items using the column filters and that no item are displayed, all columns will be hidden (because no data for those columns) and it is then impossible to reset the filters show items again.

Test plan:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4
All items are from CPL
Select another library
=> No items displayed
Without this patch the headers are hidden and it's impossible to modify
the filters
With this patch the columns that were displayed on the last draw are
still there, letting you modify the filters

Of course there might have other problematic situations.
Say you have a lot of items, and you filter on a column that will lead
to display some items without data for this column, the filter will be
hidden and there will be no way to show it again.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 5 Phil Ringnalda 2024-10-24 02:35:33 UTC
Not quite as dire as "impossible to modify" - just click Hide filters and then Show filters. Certainly "annoying to modify" though, especially if you've already set several other filters.
Comment 6 Jonathan Druart 2024-10-24 07:55:30 UTC
(In reply to Pedro Amorim from comment #3)
> (In reply to Jonathan Druart from comment #1)
> > Of course there might have other problematic situations.
> > Say you have a lot of items, and you filter on a column that will lead
> > to display some items without data for this column, the filter will be
> > hidden and there will be no way to show it again.
> 
> Are you able to provide instructions to reproduce this?

No, actually that didn't make sense. If you select a value there will be data. I was typing the commit message with what came to mind it seems...
I will remove this part from the commit message.

(In reply to Phil Ringnalda from comment #5)
> Not quite as dire as "impossible to modify" - just click Hide filters and
> then Show filters. Certainly "annoying to modify" though, especially if
> you've already set several other filters.

Yes ofc, but then you are loosing the state of the table.

Thanks you both for the signoff!
Comment 7 Jonathan Druart 2024-10-24 07:55:51 UTC
Created attachment 173253 [details] [review]
Bug 38240: Do not hide columns if no items to display

If you filter items using the column filters and that no item are displayed, all columns will be hidden (because no data for those columns) and it is then impossible to reset the filters show items again.

Test plan:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4
All items are from CPL
Select another library
=> No items displayed
Without this patch the headers are hidden and it's impossible to modify
the filters
With this patch the columns that were displayed on the last draw are
still there, letting you modify the filters

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 8 Pedro Amorim 2024-10-24 08:20:32 UTC
Converting this to PQA.
Comment 9 Katrin Fischer 2024-10-24 11:39:09 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 10 Lucas Gass (lukeg) 2024-11-19 14:55:30 UTC
Backported to 24.05.x for upcoming 24.05.06
Comment 11 Fridolin Somers 2024-12-13 13:48:57 UTC
Depends on Bug 38118 not in 23.11.x
Comment 12 Caroline Cyr La Rose 2025-04-18 19:38:35 UTC
Bug fix, nothing to add/edit in the manual.