Bug 4137 - OPACViewOthersSuggestions does not work
Summary: OPACViewOthersSuggestions does not work
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Bugs List
URL:
Keywords:
: 12057 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-02-08 04:40 UTC by Owen Leonard
Modified: 2016-12-05 21:23 UTC (History)
9 users (show)

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


Attachments
Bug 4137: Fix the OPACViewOthersSuggestions behavior (6.23 KB, patch)
2015-03-24 16:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 4137: Fix the OPACViewOthersSuggestions behavior (6.29 KB, patch)
2015-03-24 16:18 UTC, Nicole C. Engard
Details | Diff | Splinter Review
Bug 4137: Fix the OPACViewOthersSuggestions behavior (13.71 KB, patch)
2015-03-25 10:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 4137: Fix the OPACViewOthersSuggestions behavior (14.09 KB, patch)
2015-05-12 12:04 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[PASSED QA] Bug 4137: Fix the OPACViewOthersSuggestions behavior (14.13 KB, patch)
2015-05-31 21:26 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:23:35 UTC


---- Reported by oleonard@myacpl.org 2010-02-08 16:40:30 ----

The only references in the code to OPACViewOthersSuggestions are in Auth.pm, masthead.inc, and opac-suggestions.tmpl. There doesn't seem to be anything in the code to change the behavior of suggestions display based on the preference.



---- Additional Comments From nengard@gmail.com 2010-05-17 13:21:35 ----

I can confirm that this isn't working - I have tested in the current version of HEAD and only see 'my' suggestions in the OPAC no matter what the preference is set to.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:23 UTC  ---

This bug was previously known as _bug_ 4137 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4137

Actual time not defined. Setting to 0.0
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.

Comment 1 Owen Leonard 2011-05-18 15:56:59 UTC
Two choices:

1. Remove the preference and references to it in the templates.
2. Fix the bug and make the preference work again.

My library has no need of the functionality, so I vote (1). Anyone else?
Comment 2 dev_patches 2011-05-18 16:53:52 UTC
I think it has been working in 3.0.x and some libraries asked for that. 
Whether it should be kept or not, I would vote for keeping features asked by libraries.
But I am not a librarian.
Comment 3 Katrin Fischer 2012-04-15 09:38:29 UTC
Turning on the system preference 
- adds a new item 'Purchase suggestions' to the navigation in OPAC
- adds search options above the suggestions on the 'my suggestions' page in the patron account

I see various problems with how this works:

1) The purchase suggestions are only accessible for logged in users, as they are part of the patron account. There is no general page to show purchase suggestions.

2) I think the search filters for 'Me' and 'Anyone' don't work correctly.

When searching for 'Me' the pull down immediately switches back to 'Anyone'. It should reflect the results I see and be 'Me'.

Sometimes the search works, and sometimes not. I was not able to find out when it does. Sometimes searching for 'Me' would not change the display and I had to click on the tab 'My purchase suggestions' again, to get back to my own suggestions.
Comment 4 Bob Birchall 2014-06-30 01:45:06 UTC
I have just tested this (against 3.14.6) in the context of annonymous suggestions.  The functionality appears correct, that is, when the sys pref is set to 'Show' and the Purchase Suggestion link on the opac is clicked, existing suggestions are displayed, when it is set to 'Don't show' they don't.  So all good.

I have not tested as a logged in user.
Comment 5 Katrin Fischer 2014-07-12 10:12:40 UTC
I just tested this in master and it doesn't work for me. I added 2 suggestions to different patron accounts (from staff side) and switched so it should show me all suggestions. Only my suggestion shows in the list for both "Me" and "Anyone".
Comment 6 Jonathan Druart 2015-03-24 16:05:21 UTC Comment hidden (obsolete)
Comment 7 Nicole C. Engard 2015-03-24 16:18:25 UTC Comment hidden (obsolete)
Comment 8 Nicole C. Engard 2015-03-24 16:18:41 UTC
Processing files before patches
|========================>| 3 / 3 (100.00%)
Processing files after patches
|========================>| 3 / 3 (100.00%)

 OK	C4/Auth.pm
   OK	  critic
   OK	  forbidden patterns
   OK	  pod
   OK	  valid

 OK	opac/opac-suggestions.pl
   OK	  critic
   OK	  forbidden patterns
   OK	  pod
   OK	  valid

 OK	koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt
   OK	  forbidden patterns
   OK	  tt_valid
   OK	  valid_template
Comment 9 Katrin Fischer 2015-03-24 21:05:19 UTC
Hi Jonathan,

thx a lot for taking a look at those really old bugs!

I have tested this, but it does not seem to work quite right yet:

AnonymousPatron = 5
My user = 1

1) AnonSuggestions = ON
OPACViewOthersSuggestions = OFF
- purchase suggestion shows in OPAC navigation - OK
- purchase suggestion tab is gone from the patron account - NOT OK?
- Although the user is logged in, the suggestion is added to the AnonymousPatron. This seems not right, I think it should only happen for borrowers not logged in or the pref needs to be clarified:

Don't allow/allow patrons that aren't logged in to make purchase suggestions. Suggestions are connected to the AnonymousPatron syspref 

To me the first makes more sense, but maybe there is a need for both?
- allow not logged in users to also make suggestions, treat logged in users normally
- force all purchase suggestions to be anonymous?

2) AnonSuggestions = OFF
OPACViewOthersSuggestions = ON
Suggestions exist from: 5, 1, 2
- purchase suggestion shows in OPAC navigation - OK
- purchase suggestion tab shows in patron acount - OK
- If you select "Me" the pull down jumps back to "Anyone" after sending the form - NOT OK

3) AnonSuggestions = ON
OPACViewOthersSuggestions = ON
- purchase suggestion shows in OPAC navigation - OK
- purchase suggestion tab doesn't show in patron account - NOT OK?
- only the anonymous suggestion shows, even after submitting 'anyone' - NOT OK

I think we need to figure out how AnonSuggestions should work first, because this would also change 3). If it forces all to anonymous intentionally, we shouldn't show the me/anyone pull down there. If it's a bug, 3) is ok, but we should create suggestions for logged in users with their borrowernumber.
Comment 10 Jonathan Druart 2015-03-25 10:35:10 UTC Comment hidden (obsolete)
Comment 11 Jonathan Druart 2015-04-28 07:53:26 UTC
*** Bug 12057 has been marked as a duplicate of this bug. ***
Comment 12 Bernardo Gonzalez Kriegel 2015-05-12 12:04:01 UTC Comment hidden (obsolete)
Comment 13 Katrin Fischer 2015-05-31 21:26:03 UTC
Created attachment 39723 [details] [review]
[PASSED QA] Bug 4137: Fix the OPACViewOthersSuggestions behavior

This pref does not work at all, the interface let the user choose to
list all suggestions, but whatever he chooses the suggestion list is the
same.

This patch cleans a bit the suggestedby management.

There are a lot of cases to test, because linked to 2 prefs:
 AnonSuggestions and OPACViewOthersSuggestions.
1/ AnonSuggestions = 0 and OPACViewOthersSuggestions = 0
  - A non logged in user is not able to make a suggestion.
  - A logged in user is not able to see suggestions made by someone else.
2/ AnonSuggestions = 0 and OPACViewOthersSuggestions = 1
  - A non logged in user is not able to make a suggestion.
  - A logged in user is able to see suggestions made by someone else.
3/ AnonSuggestions = 1 and OPACViewOthersSuggestions = 0
  - A non logged in user is able to make a suggestion.
  The suggestedby field will be filled with the AnonymousPatron pref value.
  He is not able to see suggestions, even the ones made by AnonymousPatron.
  - A logged in user is not able to see suggestions made by someone else.
4/ AnonSuggestions = 1 and OPACViewOthersSuggestions = 1
  - A non logged in user is able to make a suggestion.
  He is able to see all suggestions.
  - A logged in user is able to see suggestions made by someone else.

In all cases a logged in user should be able to search for suggestions
(except if he is not able to see them).

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
All use cases tested, work as expected
No errors

Only comment is perhaps (in the future) a gracefull failure
when AnonymousPatron is not set, or has '0' value

Message is DBIx::Class::ResultSet::create(): Column 'suggestedby' cannot be null at ...

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Katrin Fischer 2015-05-31 21:26:38 UTC
Works wonderfully, really glad to see this fixed.
Comment 15 Tomás Cohen Arazi 2015-06-19 14:50:32 UTC
Patch pushed to master.

Good job Jonathan!
Comment 16 Chris Cormack 2015-06-29 09:40:45 UTC
Pushed to 3.20.x will be in 3.20.2
Comment 17 Liz Rea 2015-07-20 22:04:59 UTC
Pushed to 3.18.x will be in 3.18.09
Comment 18 Mason James 2015-07-25 06:49:04 UTC
Patch conflicts on 3.16.x branch