[Bug 42681] New: (Bug 34971 follow-up) serials/serials-collection.pl generates error 500
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42681 Bug ID: 42681 Summary: (Bug 34971 follow-up) serials/serials-collection.pl generates error 500 Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Serials Assignee: koha-bugs@lists.koha-community.org Reporter: januszop@gmail.com QA Contact: testopia@bugs.koha-community.org CC: baptiste.wojtkowski@biblibre.com Depends on: 34971 When working with subscription without superlibrarian permissions the page /cgi-bin/koha/serials/serials-collection.pl?subscriptionid=NNN generates error 500 with an entry: Can't use string ("NNN") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Serials.pm line 2792. in plack-error.log. This is because can_edit_subscription called in serials/serials-collection.pl (line ~234) requires a hash reference containing data from the subscription table (or an unblessed Koha::Subscription object), and not subscriptionid. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34971 [Bug 34971] Closing a subscription should require edit_subscription permission -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42681 Matthias Berland <matthias.berland@bulac.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matthias.berland@bulac.fr --- Comment #1 from Matthias Berland <matthias.berland@bulac.fr> --- We have the same problem. We are in 24.11 but I also tested in 26.06 and it still does not work. With IndependentBranches, one must have superserials in order for it to work. Can't use string ("24") as a HASH ref while "strict refs" in use at /kohadevbox/koha/C4/Serials.pm line 2802. at /kohadevbox/koha/C4/Serials.pm line 2791 in C4::Serials::_can_do_on_subscription at /kohadevbox/koha/C4/Serials.pm line 2791 2788: my $flags = C4::Context->userenv->{flags}; 2789: $userid ||= C4::Context->userenv->{'id'}; 2790: 2791: if ( C4::Context->preference('IndependentBranches') ) { 2792: return 1 2793: if C4::Context->IsSuperLibrarian() 2794: or C4::Auth::haspermission( $userid, { serials => 'superserials' } ) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42681 Amaury GAU <amaury.gau@bulac.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amaury.gau@bulac.fr -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42681 Amaury GAU <amaury.gau@bulac.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Comma delimited| |BULAC list of Sponsors| | Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |amaury.gau@bulac.fr |ity.org | Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42681 --- Comment #2 from Amaury GAU <amaury.gau@bulac.fr> --- Created attachment 211770 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211770&action=edit Bug 42681: Access serials collection with edit subscriptions can_edit_subscription in serials-collection.pl expects a subscription hashref when passed a subscription id. Staff without superserials permission get an internal servor error "Can't use string as a HASH ref". This patch allows staff without superserials permission to access to the page as it is meant to be. Test Plan : 1. Enable IndependantBranches in the system preferences. 2. Go to the Serials module, add a new subscription, and fill the form (eg. record 53, vendor "My vendor") and remember the library filled. 3. Create staff patron in that same library with edit_subscriptions permission. 4. Log in as the staff patron, go into the Serials module and look for the subscription. 5. Click on the "serial collection" on the nav bar: internal server error. 6. Apply patch. 7. Repeat 4 to 5 : the page "serial collection" loads with edit actions. 8. Change the subscription library to a different one: the subscription cannot be accessed anymore through the Serial research. 9. As a superlibrarian, look for the subscription in the Serials module: the page still loads with edit actions. Signed-off-by: Amaury Gau <amaury.gau@bulac.fr> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org