Bug 17947

Summary: Searching my library first shows the branchcode by the search bar rather than branchname
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: OPACAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: caitlingoodger.student, julian.maurice, katrin.fischer, kyle, mtj, mtompset
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 17947 Searching my library first shows the branchcode by the search bar rather than branchname
Bug 17947: Searching my library first shows the branchcode by the search bar rather than branchname
Bug 17947: Searching my library first shows the branchcode by the search bar rather than branchname
Bug 17947: Searching my library first shows the branchcode by the search bar rather than branchname
Bug 17947: Searching my library first shows the branchcode by the search bar rather than branchname

Description Aleisha Amohia 2017-01-19 22:57:53 UTC
To trigger, turn on syspref "SearchMyLibraryFirst" and go back to OPAC. You'll see by the search bar it now says 'Search (in <branchcode> only), which isn't very user-friendly.
Comment 1 Caitlin Goodger 2017-01-19 23:04:58 UTC
Created attachment 59293 [details] [review]
Bug 17947 Searching my library first shows the branchcode by the search bar rather than branchname

Test Plan
1: Turn on SearchMyLibraryFirst and go into OPAC
2: It should say Search (in <Branch Code> Only)
3: Apply patch and refresh page. It should now say Search (in <Library
Name> only)
Comment 2 Mark Tompsett 2017-01-20 00:59:04 UTC
Comment on attachment 59293 [details] [review]
Bug 17947 Searching my library first shows the branchcode by the search bar rather than branchname

Review of attachment 59293 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
@@ +155,4 @@
>                                  <label for="masthead_search"> Search
>                                      [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
>                                          [% IF ( mylibraryfirst ) %]
> +                                            (in [% LibraryNameTitle %] only)

This is based on the systempreference LibraryName.
Perhaps Branches.GetName(mylibraryfirst) is a better choice?
Comment 3 Owen Leonard 2017-01-23 14:37:30 UTC
> -  (in [% mylibraryfirst %] only)
> +  (in [% LibraryNameTitle %] only)

As M. Tompsett says, [% LibraryNameTitle %] is not going to show you the name of the user's library branch, but the name of the library "system" in a multi-branch situation.

The suggestion is to use this instead:

(in [% Branches.GetName( mylibraryfirst ) %] only)

This uses a template plugin to pull the correct library branch name based on the branchcode output by 'mylibraryfirst'

Because this patch doesn't work as expected, I'm setting this to Failed QA.
Comment 4 Aleisha Amohia 2017-01-23 22:33:52 UTC
Created attachment 59470 [details] [review]
Bug 17947: Searching my library first shows the branchcode by the search bar rather than branchname

Test Plan
1: Turn on SearchMyLibraryFirst and go into OPAC
2: It should say Search (in <Branch Code> Only)
3: Apply patch and refresh page. It should now say Search (in <Library Name> only)

Sponsored-by: Catalyst IT
Comment 5 Mark Tompsett 2017-01-24 02:23:10 UTC
Created attachment 59479 [details] [review]
Bug 17947: Searching my library first shows the branchcode by the search bar rather than branchname

Test Plan
1: Turn on SearchMyLibraryFirst and go into OPAC
2: It should say Search (in <Branch Code> Only)
3: Apply patch and refresh page. It should now say Search (in <Library Name> only)

Sponsored-by: Catalyst IT

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 6 Jonathan Druart 2017-01-26 10:26:08 UTC
Created attachment 59570 [details] [review]
Bug 17947: Searching my library first shows the branchcode by the search bar rather than branchname

Test Plan
1: Turn on SearchMyLibraryFirst and go into OPAC
2: It should say Search (in <Branch Code> Only)
3: Apply patch and refresh page. It should now say Search (in <Library Name> only)

Sponsored-by: Catalyst IT

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Jonathan Druart 2017-02-16 10:47:52 UTC
Created attachment 60320 [details] [review]
Bug 17947: Searching my library first shows the branchcode by the search bar rather than branchname

Test Plan
1: Turn on SearchMyLibraryFirst and go into OPAC
2: It should say Search (in <Branch Code> Only)
3: Apply patch and refresh page. It should now say Search (in <Library Name> only)

Sponsored-by: Catalyst IT

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Kyle M Hall 2017-02-17 15:39:35 UTC
Pushed to master for 17.05, thanks Aleisha!
Comment 9 Katrin Fischer 2017-02-19 20:37:10 UTC
String change - will come back to this after release of 16.11.04.
Comment 10 Katrin Fischer 2017-02-19 20:38:12 UTC
It's marked enhancement, but I think it should have always been the name not the code - so I'd say it's more a bug. What do others think?
Comment 11 Katrin Fischer 2017-03-12 21:50:20 UTC
I've decided to backport this - I think showing the branch name is the correct thing, especially to users in the OPAC.

This patch has been pushed to 16.11.x and will be in 16.11.05.
Comment 12 Julian Maurice 2017-03-15 11:28:39 UTC
Pushed to 3.22.x, will be in 3.22.18
Comment 13 Mason James 2017-04-03 15:00:48 UTC
Pushed to 16.05.x, for 16.05.11 release