When a patron clicks on Rate me button on the detail screen without selecting a rating option, the following error is produced: Software error: DBIx::Class::ResultSet::create(): Column 'rating_value' cannot be null at /usr/share/koha/lib/C4/Ratings.pm line 208 For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error Related to this, patrons who are not logged in, can still click the Rate me button, but are unable to make a rating selection and will get the error message as a result. Ideally, in either case, they would receive a more user-friendly message rather than the error above. Steps to reproduce: 0) Do not log in 1) Search the catalog for a title 2) View one of the search results 3) Click on the Rate me button OR 0) Log in 1) Search the catalog for a title 2) View one of the search results 3) Click on the Rate me button
The first step in diagnosing this problem is to figure out why you see a "rate me" button in the first place. The star ratings JavaScript should hide that button automatically. That you see a "rate me" button indicates that there is a JavaScript error on the page which is interrupting execution. Do you have any custom JavaScript in OPACUserJS?
Owen, I get the error when JS is disabled.
Created attachment 49858 [details] [review] Bug 16179: Do not crash if "rate me" is clicked and not rate selected If JS is disabled and a user clicks on the "Rate me" button, Koha will crashes with: DBIx::Class::ResultSet::create(): Column 'rating_value' cannot be null at /usr/share/koha/lib/C4/Ratings.pm line 208 To avoid that, opac-ratings.pl will check if a rate has been selected. Test plan: Disable JS On a record detail page, click on the "Rate me" button
Hi, disabling JavaScript gives an empty OPAC page (chrome/firefox), or more properly a 'hidden' page. This without patch.
(In reply to Bernardo Gonzalez Kriegel from comment #4) > Hi, > disabling JavaScript gives an empty OPAC page (chrome/firefox), > or more properly a 'hidden' page. This issue now has a bug report: Bug 16210.
I find this impossible to test without bug 16210 addressed.
Created attachment 49936 [details] [review] Bug 16179: Do not crash if "rate me" is clicked and not rate selected If JS is disabled and a user clicks on the "Rate me" button, Koha will crashes with: DBIx::Class::ResultSet::create(): Column 'rating_value' cannot be null at /usr/share/koha/lib/C4/Ratings.pm line 208 To avoid that, opac-ratings.pl will check if a rate has been selected. Test plan: Disable JS On a record detail page, click on the "Rate me" button TESTED PLAN: 1) go to /cgi-bin/koha/opac-ratings.pl?biblionumber=1 -- kaboom as above. 2) apply patch 3) refresh -- either login screen (don't know why) -- or if already logged in, detail page. 4) koha qa test tool NOTE: disabling JS breaks OPAC. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 50030 [details] [review] [SIGNED-OFF] Bug 16179: Do not crash if "rate me" is clicked and not rate selected If JS is disabled and a user clicks on the "Rate me" button, Koha will crashes with: DBIx::Class::ResultSet::create(): Column 'rating_value' cannot be null at /usr/share/koha/lib/C4/Ratings.pm line 208 To avoid that, opac-ratings.pl will check if a rate has been selected. Test plan: Disable JS On a record detail page, click on the "Rate me" button TESTED PLAN: 1) go to /cgi-bin/koha/opac-ratings.pl?biblionumber=1 -- kaboom as above. 2) apply patch 3) refresh -- either login screen (don't know why) -- or if already logged in, detail page. 4) koha qa test tool Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> I tested successfully by temporarily removing the modification made by Bug 16210.
Created attachment 50222 [details] [review] [PASSED QA] Bug 16179: Do not crash if "rate me" is clicked and not rate selected If JS is disabled and a user clicks on the "Rate me" button, Koha will crashes with: DBIx::Class::ResultSet::create(): Column 'rating_value' cannot be null at /usr/share/koha/lib/C4/Ratings.pm line 208 To avoid that, opac-ratings.pl will check if a rate has been selected. Test plan: Disable JS On a record detail page, click on the "Rate me" button TESTED PLAN: 1) go to /cgi-bin/koha/opac-ratings.pl?biblionumber=1 -- kaboom as above. 2) apply patch 3) refresh -- either login screen (don't know why) -- or if already logged in, detail page. 4) koha qa test tool Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> I tested successfully by temporarily removing the modification made by Bug 16210. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to Master - Should be in the May 2016 Release. Thanks!
Patch pushed to 3.22.x, will be in 3.22.6
Pushed to 3.22.x, will be in 3.20.11.