Bug 6950

Summary: Cannot sort the results of a tag search
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: normal    
Priority: P5 - low CC: chris, jonathan.druart, nengard, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 6950: Make the resort working when searching for a tag
Bug 6950: Hide the resort option when searching for a tag
Bug 6950: Hide the resort option when searching for a tag
[Signed-off] Bug 6950: Hide the resort option when searching for a tag
Bug 6950: Hide the resort option when searching for a tag
[PASSED QA] Bug 6950: Hide the resort option when searching for a tag

Description Owen Leonard 2011-09-30 15:40:50 UTC
If you click a link from the Tag Cloud, the results page offers the usual select menu to resort your results. However, doing so resubmits the search as a standard keyword search. 

I'm assuming there isn't even a way to pass a different sort to the tag search, so it might be necessary to simply hide the resort option when displaying the results of a tag search.
Comment 1 Jonathan Druart 2015-03-26 16:24:59 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-03-26 18:01:28 UTC
Applied patch
In OPAC, went to Tag cloud, clicked on tag 'Geneva'

Two biblios are tagged with Geneva:

Rollo in Geneva
by Abbott, Jacob, 1803-1879. 

Mystery at Geneva An Improbable Tale of Singular Happenings
by Macaulay, Rose, 1881-1958. 

Seems to be sorted by Author ( Abbot < Macaulay )

The link reads:
...cgi-bin/koha/opac-search.pl?tag=Geneva&q=Geneva

At top right, I click on sorting by Title. 
This should change the display (Mystery < Rollo)

Page reloads
I have still first Rollo, then Mystery

The link reads now:
/cgi-bin/koha/opac-search.pl?idx=kw&q=Geneva&sort_by=title_az&tag=Geneva&addto=Add+to...&biblionumber=4673&biblionumber=44150&newtag44150=
Comment 3 Jonathan Druart 2015-03-27 09:49:17 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2015-03-27 09:50:37 UTC
(In reply to Marc Véron from comment #2)
Sorry about that, it was a very naive approach and cannot work (I am sure I have tested!!....)
The last patch only removes the resort option.
Comment 5 Marc Véron 2015-03-27 13:51:06 UTC
Hi Jonathan,

Sorry, the sort drop-down is still visible.
Seems that the var tag is not defined for the template.

I think it could be fixed after the following lines in opac/opac-search.pl, around line 347:

my $tag;
$tag = $params->{tag} if $params->{tag};

I added following line:
$template->param(tag => $tag);

This way, the sorting drop down disappears as expected if tags are displayed. With a 'normal' search, sorting drop down appears.

What do you think about?
Marc
Comment 6 Jonathan Druart 2015-03-27 14:44:09 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2015-03-27 14:45:10 UTC
(In reply to Marc Véron from comment #5)
Marc,
Yes sorry (again) I forgot to add the pl changes to the last patch!
Comment 8 Marc Véron 2015-03-27 15:04:03 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2015-04-05 21:13:48 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2015-04-05 21:14:19 UTC
Created attachment 37513 [details] [review]
[PASSED QA] Bug 6950: Hide the resort option when searching for a tag

If you click a link from the Tag Cloud, the results page offers the
usual select menu to resort your results. However, doing so resubmits
the search as a standard keyword search.

Test plan:
1/ Click on a tag
2/ Confirm that the resort dropdown list does not appear.

Dropdown list disappears with tags as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2015-04-05 21:15:04 UTC
And another one bites the dust... :)
Comment 12 Tomás Cohen Arazi (tcohen) 2015-04-08 19:43:03 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 13 Chris Cormack 2015-04-12 08:01:55 UTC
Pushed to 3.18.x will be in 3.18.6
Comment 14 Jonathan Druart 2015-04-16 14:10:26 UTC
*** Bug 10813 has been marked as a duplicate of this bug. ***