Bug 12609

Summary: Replace use of DBI in C4::Ratings with DBIx::Class
Product: Koha Reporter: Kyle M Hall <kyle>
Component: Architecture, internals, and plumbingAssignee: Kyle M Hall <kyle>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 12608, 13998    
Attachments: Bug 12609 - Replace use of DBI in C4::Ratings with DBIx::Class
Bug 12609 - Replace use of DBI in C4::Ratings with DBIx::Class
Bug 12609 - Replace use of DBI in C4::Ratings with DBIx::Class
Bug 12609 - Replace use of DBI in C4::Ratings with DBIx::Class
Bug 12609 - Replace use of DBI in C4::Ratings with DBIx::Class
Bug 12609: Add some unit tests for C4::Ratings
[PASSED QA] Bug 12609 - Replace use of DBI in C4::Ratings with DBIx::Class
[PASSED QA] Bug 12609: Add some unit tests for C4::Ratings

Description Kyle M Hall 2014-07-18 14:41:34 UTC
We should replace the use of DBI in C4::Ratings with DBIC instead.
Comment 1 Kyle M Hall 2014-07-18 14:42:33 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2014-07-18 14:43:40 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2014-07-18 14:44:37 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2014-07-18 14:45:41 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2014-08-29 14:42:24 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2014-08-29 14:53:13 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2014-09-07 23:01:51 UTC
Created attachment 31449 [details] [review]
[PASSED QA] Bug 12609 - Replace use of DBI in C4::Ratings with DBIx::Class

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Ratings.t
3) Note all unit tests pass

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Also tested:
- Adding a rating
- Rating displayed on detail
- Rating displayed on results
- Modifying a rating
- Change displayed correctly on detail and results
Comment 8 Katrin Fischer 2014-09-07 23:02:04 UTC
Created attachment 31450 [details] [review]
[PASSED QA] Bug 12609: Add some unit tests for C4::Ratings

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 9 Tomás Cohen Arazi 2014-09-18 01:12:20 UTC
Patches pushed to master.

Thanks Kyle and Jonathan!
Comment 10 Jonathan Druart 2015-04-15 11:11:16 UTC
(In reply to Tomás Cohen Arazi from comment #9)
> Patches pushed to master.
> 
> Thanks Kyle and Jonathan!

This breaks opac-ratings-ajax.pl:
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 11 Jonathan Druart 2015-04-15 11:17:16 UTC
(In reply to Jonathan Druart from comment #10)
> (In reply to Tomás Cohen Arazi from comment #9)
> > Patches pushed to master.
> > 
> > Thanks Kyle and Jonathan!
> 
> This breaks opac-ratings-ajax.pl:
> 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.

Actually it's not introduced by this patch, the issue does not exist on 3.18.x