Bug 17018 - Split AdvancedSearchTypes for staff and OPAC
Summary: Split AdvancedSearchTypes for staff and OPAC
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-02 12:58 UTC by Katrin Fischer
Modified: 2022-12-12 21:23 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Add a new system preference, OpacAdvancedSearchTypes, as an OPAC-specific version of the AdvancedSearchTypes preference. Values from AdvancedSearchTypes are copied to OpacAdvancedSearchTypes so that behavior is consistent.
Version(s) released in:
22.05.00


Attachments
Bug 17018: Split AdvancedSearchTypes for staff and OPAC (8.37 KB, patch)
2022-01-14 16:38 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17018: Split AdvancedSearchTypes for staff and OPAC (8.42 KB, patch)
2022-01-18 23:27 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 17018: Split AdvancedSearchTypes for staff and OPAC (8.51 KB, patch)
2022-01-19 12:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17018: (QA follow-up) OpacAdvancedSearchTypes is type multiple (4.07 KB, patch)
2022-01-29 06:07 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 17018: Split AdvancedSearchTypes for staff and OPAC (9.86 KB, patch)
2022-02-14 19:41 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17018: Split AdvancedSearchTypes for staff and OPAC (9.86 KB, patch)
2022-03-16 12:47 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17018: Split AdvancedSearchTypes for staff and OPAC (12.76 KB, patch)
2022-03-23 15:38 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17018: Split AdvancedSearchTypes for staff and OPAC (12.82 KB, patch)
2022-03-23 15:45 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 17018: Split AdvancedSearchTypes for staff and OPAC (12.87 KB, patch)
2022-03-31 15:46 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2016-08-02 12:58:33 UTC
It would be nice if you could configure AdvancedSearchTypes differently for staff and opac advanced search.
Comment 1 Owen Leonard 2022-01-14 16:38:57 UTC Comment hidden (obsolete)
Comment 2 Lucas Gass 2022-01-18 23:27:15 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2022-01-19 12:56:22 UTC Comment hidden (obsolete)
Comment 4 Fridolin Somers 2022-01-29 00:55:03 UTC
New behavior, please add a nice release note
Comment 5 Fridolin Somers 2022-01-29 00:58:14 UTC
(In reply to Fridolin Somers from comment #4)
> New behavior, please add a nice release note

I take it from commit, looks good.
Comment 6 Fridolin Somers 2022-01-29 06:07:42 UTC Comment hidden (obsolete)
Comment 7 Fridolin Somers 2022-01-29 06:09:47 UTC
Will be pushed when Bug 29878 is ready
Comment 8 Katrin Fischer 2022-02-02 22:35:25 UTC
I don't think we should push this as multiple, because we lose the ability to determine the sequence of the tabs. This is a feature we have used for several libraries depending on how they set up locations, collections and itemtypes.
Comment 9 Katrin Fischer 2022-02-02 22:37:27 UTC
(In reply to Katrin Fischer from comment #8)
> I don't think we should push this as multiple, because we lose the ability
> to determine the sequence of the tabs. This is a feature we have used for
> several libraries depending on how they set up locations, collections and
> itemtypes.

This is a new feature, but being aware you want the same change for the existing pref. (dependency on bug 29878)
Comment 10 Owen Leonard 2022-02-14 14:30:50 UTC
I will re-work without the dependency on Bug 29878.
Comment 11 Owen Leonard 2022-02-14 19:41:42 UTC Comment hidden (obsolete)
Comment 12 Shi Yao Wang 2022-03-10 18:53:59 UTC
Patch doesn't apply.


Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 17018: Split AdvancedSearchTypes for staff and OPAC
error: sha1 information is lacking or useless (opac/opac-search.pl).
error: could not build fake ancestor
Patch failed at 0001 Bug 17018: Split AdvancedSearchTypes for staff and OPAC
Comment 13 Owen Leonard 2022-03-16 12:47:39 UTC Comment hidden (obsolete)
Comment 14 Shi Yao Wang 2022-03-16 16:26:27 UTC
I don't see any changes in the "Refine your search" sidebar in "Most popular" page after changing the values in OpacAdvancedSearchTypes preference.
Comment 15 Lucas Gass 2022-03-22 15:35:54 UTC
(In reply to shi-yao.wang from comment #14)
> I don't see any changes in the "Refine your search" sidebar in "Most
> popular" page after changing the values in OpacAdvancedSearchTypes
> preference.

I don't see these changes either. In opac-topissues.inc it seems like "OpacAdvancedSearchTypes.grep('^itemtypes$').size" and  "OpacAdvancedSearchTypes.grep('^ccode$').size" always evaluate to 0 even if the value in the system preference is correct.
Comment 16 Owen Leonard 2022-03-23 15:38:38 UTC Comment hidden (obsolete)
Comment 17 Lucas Gass 2022-03-23 15:45:57 UTC Comment hidden (obsolete)
Comment 18 Kyle M Hall 2022-03-31 15:46:08 UTC
Created attachment 132799 [details] [review]
Bug 17018: Split AdvancedSearchTypes for staff and OPAC

This patch adds a new system preference, OpacAdvancedSearchTypes, as an
OPAC-specific version of the AdvancedSearchTypes preference. Values from
AdvancedSearchTypes are copied to OpacAdvancedSearchTypes so that
behavior is consistent.

The patch also alters the output of the "Most popular" page so that:
1. The page heading is correct ("Most popular titles" instead of "Top
issues").
2. The table show both item type and collection whether or not the user
has submitted query with one of those fields as a filter.

To test, apply the patch and run the database update process.

- Go to Administration -> System preferences.
- Search for AdvancedSearchTypes. You should get two results, one for
  the OPAC preference and one for the staff interface.
- Check that the OpacAdvancedSearchTypes settings match the
  AdvancedSearchTypes settings.
- View the advanced search pages in the staff interface and OPAC to
  confirm that the tabs look correct.
- Change the OpacAdvancedSearchTypes and AdvancedSearchTypes settings to
  be different and confirm that each is applied separately to each
  interface.
- Enable the OpacTopissue system preference.
- View the "Most popular" page in the OPAC.
  - The page heading should be correct.
  - The OpacAdvancedSearchTypes settings should be reflected in the
    "Refine your search" sidebar: If "Collection" is checked, a filter
    for collection should appear. If "Item types" is checked, a filter
    for item types should appear.
  - The output of your search should include collection and item type
    regardless of what filters you've submitted.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 19 Fridolin Somers 2022-04-12 15:13:54 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄