Bug 38240 - Filtering resulting in no result will hide filters
Summary: Filtering resulting in no result will hide filters
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 38118
Blocks: 33484
  Show dependency treegraph
 
Reported: 2024-10-23 13:34 UTC by Jonathan Druart
Modified: 2024-11-19 14:55 UTC (History)
4 users (show)

See Also:
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:


Attachments
Bug 38240: Do not hide columns if no items to display (1.88 KB, patch)
2024-10-23 13:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38240: Do not hide columns if no items to display (1.94 KB, patch)
2024-10-23 14:55 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38240: Do not hide columns if no items to display (1.99 KB, patch)
2024-10-24 02:33 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 38240: Do not hide columns if no items to display (1.75 KB, patch)
2024-10-24 07:55 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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