Bugzilla – Attachment 84211 Details for
Bug 22173
Search Groups broken by change in expected structure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22173: Search Groups broken by change in expected structure
Bug-22173-Search-Groups-broken-by-change-in-expect.patch (text/plain), 6.94 KB, created by
Maryse Simard
on 2019-01-18 19:17:35 UTC
(
hide
)
Description:
Bug 22173: Search Groups broken by change in expected structure
Filename:
MIME Type:
Creator:
Maryse Simard
Created:
2019-01-18 19:17:35 UTC
Size:
6.94 KB
patch
obsolete
>From e8ff40384b21deb3fc28070797ea81e1faad9d5f Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 18 Jan 2019 13:18:03 -0500 >Subject: [PATCH] Bug 22173: Search Groups broken by change in expected > structure > >The original logic of Search Groups using the heirarchical library groups was to enable search groups on a root group and have each sub group be a search group listed in the pulldown: > >RootGroup: > SearchGroup1: > LibraryA > LibraryB > SearchGroup2: > LibraryC > LibraryD > SearchGroup3: > LibraryE > LibraryF > >At some point, the code was changed to expect the each search group to be the root group: > >RootSearchGroup1: > LibraryA > LibraryB > >RootSearchGroup2: > LibraryC > LibraryD > >RootSearchGroup3: > LibraryE > LibraryF > >It's likely that both styles are being used in production now with different versions. If a library upgrades, their search groups will be broken. If we revert the change, currently up to date libraries will have search groups broken. > >Instead, we should accommodate both configurations. > >So, if a root group has libraries as direct children, it should be displayed as a search group. If it does not, we should display the child search groups instead. > >Test Plan: >1) Set up a root group with multiple subgroups each with libraries, > enable staff and opac search groups for that root group >2) Note the root group is displayed in all the search pulldowns instead > of the subgroups >3) Apply this patch >4) Restart all the things! >5) Note the search pulldowns now contain the subgroups instead >6) Create another root group, add only libraries to it. > Set it as a search group for staff and opac. >7) Note the search pulldowns now contain this group as well! > >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> >--- > .../intranet-tmpl/prog/en/modules/catalogue/advsearch.tt | 12 ++++++++++-- > koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 16 ++++++++++++---- > .../opac-tmpl/bootstrap/en/modules/opac-advsearch.tt | 10 +++++++++- > 3 files changed, 31 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >index e6a143f..02f3ca5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >@@ -253,8 +253,16 @@ > <select name="multibranchlimit" id="categoryloop"> > <option value=""> -- none -- </option> > [% FOREACH sg IN search_groups %] >- [% UNLESS sg.branchcode %] >- <option value="[% sg.id | html %]">[% sg.title | html %]</option> >+ [% IF sg.libraries %] >+ [% SET groups = sg %] >+ [% ELSE %] >+ [% SET groups = sg.children %] >+ [% END %] >+ >+ [% FOREACH g IN groups %] >+ [% UNLESS g.branchcode %] >+ <option value="[% g.id | html %]">[% g.title | html %]</option> >+ [% END %] > [% END %] > [% END %] > </select> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 9466c2d..ae64a90 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -232,11 +232,19 @@ > </optgroup> > <optgroup label="Groups"> > [% FOREACH lsg IN LibrarySearchGroups %] >- [% IF lsg.id == opac_name %] >- <option selected="selected" value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option> >+ [% IF lsg.libraries %] >+ [% SET groups = lsg %] > [% ELSE %] >- <option value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option> >- [% END # / bc.selected %] >+ [% SET groups = lsg.children %] >+ [% END %] >+ >+ [% FOREACH g IN groups %] >+ [% IF g.id == opac_name %] >+ <option selected="selected" value="multibranchlimit-[% g.id | html %]">[% g.title | html %]</option> >+ [% ELSE %] >+ <option value="multibranchlimit-[% g.id | html %]">[% g.title | html %]</option> >+ [% END # / bc.selected %] >+ [% END %] > [% END %] > </optgroup> > [% END # / BranchCategoriesLoop %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >index 1d7aada..d27edc0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >@@ -232,7 +232,15 @@ > <select name="multibranchlimit" id="categoryloop"> > <option value=""> -- none -- </option> > [% FOREACH sg IN search_groups %] >- <option value="[% sg.id | html %]">[% sg.title | html %]</option> >+ [% IF sg.libraries %] >+ [% SET groups = sg %] >+ [% ELSE %] >+ [% SET groups = sg.children %] >+ [% END %] >+ >+ [% FOREACH g IN groups %] >+ <option value="[% g.id | html %]">[% g.title | html %]</option> >+ [% END %] > [% END %] > </select> > [% END %] >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22173
:
84209
| 84211