Bug 14830 - anonymous purchase suggestions are invisible/inaccessible in staff interface
Summary: anonymous purchase suggestions are invisible/inaccessible in staff interface
Status: RESOLVED DUPLICATE of bug 24073
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P3 normal with 5 votes (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 14839
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-16 02:28 UTC by Mason James
Modified: 2019-12-22 14:03 UTC (History)
4 users (show)

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


Attachments
Bug 14830 - anonymous purchase suggestions are invisible/inaccessible in staff interface (2.02 KB, patch)
2015-10-08 09:44 UTC, Mason James
Details | Diff | Splinter Review
pix, after patch (125.21 KB, image/png)
2015-10-08 09:48 UTC, Mason James
Details
Bug 14830 - anonymous purchase suggestions are invisible/inaccessible in staff interface (2.02 KB, patch)
2015-10-08 09:53 UTC, Mason James
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mason James 2015-09-16 02:28:28 UTC
this seems to be due to anon. suggestions being created with a NULL branchcode

more info to come...
Comment 1 Mason James 2015-10-08 09:44:35 UTC Comment hidden (obsolete)
Comment 2 Mason James 2015-10-08 09:47:06 UTC
this patch adds some SQL to display suggestion rows with a NULL branchcode, in the staff interface
Comment 3 Mason James 2015-10-08 09:48:52 UTC
Created attachment 43245 [details]
pix, after patch
Comment 4 Mason James 2015-10-08 09:53:03 UTC
Created attachment 43246 [details] [review]
Bug 14830 - anonymous purchase suggestions are invisible/inaccessible in staff interface

To test bug...

1/ set various suggestion sysprefs like so

mysql> select variable, value  from systempreferences where variable like '%sugg%';
+-------------------------------------+-------+
| variable                            | value |
+-------------------------------------+-------+
| AllowPurchaseSuggestionBranchChoice | 0     |
| AnonSuggestions                     | 1     |
| OpacSuggestionManagedBy             | 1     |
| OPACViewOthersSuggestions           | 0     |
| suggestion                          | 1     |
+-------------------------------------+-------+

2/ create an generic ANON borrower for testing

3/ set 'AnonymousPatron' syspref to ANON's borrowernumber

4/ add a suggestion from the OPAC, without being logged in (ie: an anonymous suggestion)

5/ go to staff interface , fail to see suggestion :'(
    https://demo-admin.yourkoha.foo/cgi-bin/koha/suggestion/suggestion.pl

6/ apply patch...

7/ go to staff interface , see suggestion! :) (pix attached)
    https://demo-admin.yourkoha.foo/cgi-bin/koha/suggestion/suggestion.pl

8/ reward yourself with cake (optional)
Comment 5 Marc Véron 2015-10-08 14:29:26 UTC
Testing:

- Check with mysql: I did not have branchcode = NULL in the suggestions table.
- I tried to have one by removing syspref AnonymousPatron and then submit a
suggestion from OPAC, it resulted in an software error on Suggestions.pm line 108 (Column 'suggestedby' canot be null). 
- I set the branchcode of one of the suggestions to NULL usimg mysql
- I could reproduce the issue (the one with NULL branchcode did not show up)
- With patch, the NULL-suggestion shows up, that is OK so far.


More testing:
- In the mysgl table I have following branchcodes: FFL, FFL, FFL, MPL, NULL, all with status ASKED

- On the home page, I have "Suggestions pending approval: 5" 

- But not all suggestions show up when managing suggestions, only the ones with the same branchcode as the staff user (branch code FFL, all rights set, superlibrarian), plus the NULL one if the patch is applied.

That is not consistent. 

The question is:
Should the librarian be able to manage the suggestions for all branches?

- If yes, all sggestions should display on Home > Acquisitions > Suggestions management (I think including the NULL branchcode ones). 
  I would expect that for IndependentBranches = 'Don't prevent...' and superlibrarians. (That's the behaviour of this syspref for other things).

- If no, the counter on the home page needs some adjustement to show the count of pending suggestions that are manageable for the staff users branch
  I would expect that for IndependentBranches = 'Don't prevent...' current staff user is not a superlibrarian.
Comment 6 Marc Véron 2015-10-16 13:22:10 UTC
One more finding: A suggestion ist not visible / manageable if created in staff client with Library set to "Any"

The value for the library code in the database is en empty string in that case. It is not visible in staff client, not even for superlibrarians (with and without patch).
Comment 7 Marjorie Barry-Vila 2018-10-02 15:07:23 UTC
Still valid.


Marjorie
Comment 8 Nick Clemens 2018-10-02 16:56:04 UTC
This is not quite true, you can view these suggestions, they just don't show up by default.

If you click on 'Acquisition Information' on the left side of the screen it expands into filters for 'Book fund' and 'Library'

Set 'Library' to 'Any' and these suggestions should show

This is definitely not intuitive and should be addressed, perhaps if we indicate on the screen somewhere that we are already filtering by branch?
Comment 9 Katrin Fischer 2019-12-22 14:02:08 UTC

*** This bug has been marked as a duplicate of bug 24073 ***
Comment 10 Katrin Fischer 2019-12-22 14:03:16 UTC
Marked duplicate with a newer bug about this issue/topic - I think it's a recurring problem but with indybranches etc not trivial to solve in a good way.