Summary: | Clicking Rate me button in OPAC without selecting rating produces error | ||
---|---|---|---|
Product: | Koha | Reporter: | John Yorio <jyorio> |
Component: | OPAC | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | bgkriegel, brendan, cbrannon, f.demians, jonathan.druart, julian.maurice |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | 16210 | ||
Bug Blocks: | |||
Attachments: |
Bug 16179: Do not crash if "rate me" is clicked and not rate selected
Bug 16179: Do not crash if "rate me" is clicked and not rate selected [SIGNED-OFF] Bug 16179: Do not crash if "rate me" is clicked and not rate selected [PASSED QA] Bug 16179: Do not crash if "rate me" is clicked and not rate selected |
Description
John Yorio
2016-03-31 16:16:04 UTC
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. |