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.
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...
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...
Created attachment 37904 [details] [review] 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.
This is a blocker for 3.20.
Created attachment 37941 [details] [review] [SIGNED OFF] 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>
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
Patch pushed to master. Good catch Jonathan!
Created attachment 38287 [details] [review] Bug 13998: (RM followup) tests expect data on the database Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>