Bug 12136 - Problem in opac-topissues.pl if AdvancedSearchTypes has multiple values (separated by pipes)
Summary: Problem in opac-topissues.pl if AdvancedSearchTypes has multiple values (sepa...
Status: RESOLVED DUPLICATE of bug 11139
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-24 19:03 UTC by Marc Véron
Modified: 2015-10-15 06:54 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 12136 - Problem in opac-topissues.pl if AdvancedSearchTypes has multiple values (separated by pipes) (1.87 KB, patch)
2014-04-24 19:37 UTC, Marc Véron
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2014-04-24 19:03:34 UTC
The "Most popular" feature in Opac is broken if AdvancedSearchTypes has multiple values (separated by pipes).

To reproduce:
1) Set OpacTopissue preferende to "Allow"
2) Set AdvancedSearchTypes to an empty value
-> "Most popular" shows "Limit to" with "All item types" (OK)
3) Set AdvancedSearchTypes to 'itemtypes'
-> "Most popular" shows "Limit to" with "All item types" (OK)
4) Set AdvancedSearchTypes to 'ccode'
-> "Most popular" shows "Limit to" with "All collections" (OK)
5) Set AdvancedSearchTypes to 'ccode|itemtypes' or 'itemtypes|ccode'
-> "Most popular" shows "Limit to" with "All item types" with EMPTY dropdown list (BUG)

This is due to wrong comparisions in opac-topissues.pl combined with the fact that the program logic can only display one drop down list.

Patch follows.
Comment 1 Marc Véron 2014-04-24 19:37:55 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2014-04-25 13:08:30 UTC
> 1) Set OpacTopissue preferende to "Allow"
> 2) Set AdvancedSearchTypes to an empty value
> -> "Most popular" displays "Limit to" with "All item types"

I get a dropdown with "All collections" and a list of collection codes. Submitting the form with default values (10 titles, all libraries, all collections, 3 months) returns no results. Only by changing the time span to "no limit" do I get results.

> 3) Set AdvancedSearchTypes to 'itemtypes'
> -> "Most popular" displays "Limit to" with "All item types"

Using 'itemtypes' I do get a list of item types, but the same results for a default search as above.

> 4) Set AdvancedSearchTypes to 'ccode'
> -> "Most popular" displays "Limit to" with "All collections"

Same results as in step 1-2.

> 5) Set AdvancedSearchTypes to 'ccode|itemtypes' or 'itemtypes|ccode' or
> 'ccode'
> -> "Most popular" should now display  "Limit to" with "All collections"

Same results as in step 1-2. Shouldn't these combination value offer some combination of limiters? I would expect either a dropdown which combined both collection codes and item types, or a separate dropdown for collection and item type.

And what about location? This patch seems to have broken the option to limit by shelving location if AdvancedSearchTypes is set to 'loc'.

If we're going to address this problem doesn't the patch need to cover the search query as well?
Comment 3 Marc Véron 2014-04-27 15:58:25 UTC
Hi Owen,

Thanks for the comments and for testing.

The program logic in  handles the cases "itemtypes" and "ccode" only, there is no code for "loc" (as far as I can see). I do not know why, I suppose this has historical reasons. My patch only tries to fix the problem with pipe-separated values in AdvancedSearchTypes by deciding what value (itemtypes or ccode) to take, because the existing code in opac-topissues.pl definitvely can not digest values like "itemtypes|ccode".

Can you please repeat your tests without my patch? - I suppose that you will get the same or similar results.

Maybe there ist a relation to Bug 9959?

And I agree with your comment:
"Shouldn't these combination value offer some combination of limiters? I would expect either a dropdown which combined both collection codes and item types, or a separate dropdown for collection and item type."
With other words: The whole functionality would need a re-write. This would be a somewhat bigger thing, though.
Comment 4 Marc Véron 2015-05-29 12:13:29 UTC
Putting this to "In Discussion"

The feature is still broken on current master if AdvancedSearchTypes contains more than one pipe separated value. 

BTW: Pipe separated values were introduced with version 3.8.0: More options for AdvancedSearchTypes (7031)
Comment 5 Marc Véron 2015-10-15 06:54:41 UTC

*** This bug has been marked as a duplicate of bug 11139 ***