Bug 13998 - opac-ratings-ajax.pl is broken
Summary: opac-ratings-ajax.pl is broken
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Katrin Fischer
URL:
Whiteboard:
Keywords:
Depends on: 12609 13852
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-15 11:15 UTC by Jonathan Druart
Modified: 2015-12-03 22:11 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13998: Reintroduce use of Koha::Database for C4::Ratings (901 bytes, patch)
2015-04-15 11:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED OFF] Bug 13998: Reintroduce use of Koha::Database for C4::Ratings (970 bytes, patch)
2015-04-16 02:56 UTC, Nick Clemens
Details | Diff | Splinter Review
[PASSED QA] Bug 13998: Reintroduce use of Koha::Database for C4::Ratings (1.06 KB, patch)
2015-04-17 10:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 13998: (RM followup) tests expect data on the database (3.47 KB, patch)
2015-04-21 16:51 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2015-04-15 11:15:12 UTC
To reproduce: Enable the star rating at the OPAC, go on a record detail page, note with the stars, nothing happens.

Actually yes, boom in the JS console and error in Koha logs:
[Wed Apr 15 13:12:52 2015] opac-ratings-ajax.pl: Can't locate object method "new" via package "Koha::Database" (perhaps you forgot to load "Koha::Database"?) at /home/koha/src/C4/Ratings.pm line 206.
Comment 1 Jonathan Druart 2015-04-15 11:27:41 UTC
This has been introduced by
commit  f14963605924eacbbaf965c600c65401288b6f2f
Date:   Tue Mar 17 14:50:14 2015 +0100
    Bug 13852 - Manage C4::VirtualShelves in C4::Auth for performance


This is crazy, really...
Comment 2 Jonathan Druart 2015-04-15 11:33:08 UTC
For what I understand it's because, before bug 13852, Koha::Database was used in C4:Members which was used by C4::VirtualShelves which was used by C4::Auth which was finally used by C4::Ratings...
Comment 3 Jonathan Druart 2015-04-15 11:49:47 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2015-04-15 11:50:27 UTC
This is a blocker for 3.20.
Comment 5 Nick Clemens 2015-04-16 02:56:22 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2015-04-17 10:33:33 UTC
Created attachment 38025 [details] [review]
[PASSED QA] Bug 13998: Reintroduce use of Koha::Database for C4::Ratings

It has been removed by bug 13852, because before bug 13852,
Koha::Database was used in C4:Members which was used by
C4::VirtualShelves which was used by C4::Auth which was finally used by
C4::Ratings...

Test plan:
At the opac, record detail page, note the record using the stars.
Without this patch it does not work.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

http://bugs.koha-community.org/show_bug.cgi?id=12998
Comment 7 Tomás Cohen Arazi 2015-04-20 13:32:35 UTC
Patch pushed to master.

Good catch Jonathan!
Comment 8 Tomás Cohen Arazi 2015-04-21 16:51:22 UTC
Created attachment 38287 [details] [review]
Bug 13998: (RM followup) tests expect data on the database

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>