The version of the jQuery star ratings plugin that Koha uses is not compatible with the latest version of jQuery. If we want to be able to upgrade jQuery we need to also upgrade the star ratings plugin, which is now at version 4.11 (we have v3.14).
Although the star ratings plugin site (http://www.fyneworks.com/jquery/star-rating/) says "Compatible with jQuery 1.3+ and the latest 1.9" it in fact requires at minimum jQuery 1.8.
I notice the plugin hasn't been updated for three years. We might want to consider alternatives in case new versions of jQuery cause it to break.
We should consider looking for an upgrade or replacement which would fix Bug 11827.
(In reply to Owen Leonard from comment #3) > We should consider looking for an upgrade or replacement which would fix Bug > 11827. Hi Owen, this one looks quite good... http://antenna.io/demo/jquery-bar-rating/examples/ I did spot this list too... https://www.sitepoint.com/10-jquery-rating-plugins/
(In reply to Mason James from comment #4) > Hi Owen, this one looks quite good... > http://antenna.io/demo/jquery-bar-rating/examples/ I'm working on a solution now that uses this.
Created attachment 76049 [details] [review] Bug 10659: Upgrade jQuery star ratings plugin This patch replaces our current jQuery star ratings plugin with a newer plugin which will be compatible with newer versions of jQuery: http://antenna.io/demo/jquery-bar-rating/examples/ To test you should have one or more records in your catalog with star ratings. - Apply the patch and set the OpacStarRatings system preference to "results and details" - Perform a search in the catalog which will return one or more titles which have ratings. - Confirm that the ratings appear correctly and the ratings are read-only. - Open the "normal" detail page for that record. - Confirm that the star rating appears correctly. - Test setting and re-setting your star rating. Confirm that it is saved. - Confirm that the "cancel rating" link appears when you have a rating set, and that it disappears after you click it. - Test that the "only details" and disabled options of the OpacStarRatings preference work as they should.
Created attachment 76050 [details] [review] Bug 10659: (follow-up) Compiled CSS This patch contains the compiled CSS.
Created attachment 76051 [details] [review] Bug 10659: (follow-up) Add plugin information to the about page This patch updates the about page in the staff client, replacing the information about the jQuery Star Ratings plugin with information about the new jQuery Bar Ratings plugin. To test, apply the patch and go to the about page in the staff client. Confirm that the new information appears correctly.
Created attachment 76487 [details] [review] Bug 10659: Upgrade jQuery star ratings plugin This patch replaces our current jQuery star ratings plugin with a newer plugin which will be compatible with newer versions of jQuery: http://antenna.io/demo/jquery-bar-rating/examples/ To test you should have one or more records in your catalog with star ratings. - Apply the patch and set the OpacStarRatings system preference to "results and details" - Perform a search in the catalog which will return one or more titles which have ratings. - Confirm that the ratings appear correctly and the ratings are read-only. - Open the "normal" detail page for that record. - Confirm that the star rating appears correctly. - Test setting and re-setting your star rating. Confirm that it is saved. - Confirm that the "cancel rating" link appears when you have a rating set, and that it disappears after you click it. - Test that the "only details" and disabled options of the OpacStarRatings preference work as they should.
Created attachment 76488 [details] [review] Bug 10659: (follow-up) Add plugin information to the about page This patch updates the about page in the staff client, replacing the information about the jQuery Star Ratings plugin with information about the new jQuery Bar Ratings plugin. To test, apply the patch and go to the about page in the staff client. Confirm that the new information appears correctly.
Created attachment 76489 [details] [review] Bug 10659: (follow-up) Compiled CSS This patch contains the compiled CSS.
Attempted to apply but ran into merge fails: $ git bz apply -s 10659 Bug 10659 - Upgrade jQuery star ratings plugin 76487 - Bug 10659: Upgrade jQuery star ratings plugin 76488 - Bug 10659: (follow-up) Add plugin information to the about page 76489 - Bug 10659: (follow-up) Compiled CSS Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 10659: Upgrade jQuery star ratings plugin Using index info to reconstruct a base tree... M koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt M koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt M koha-tmpl/opac-tmpl/bootstrap/less/opac.less Falling back to patching base and 3-way merge... Removing koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.rating.js Auto-merging koha-tmpl/opac-tmpl/bootstrap/less/opac.less Removing koha-tmpl/opac-tmpl/bootstrap/images/star-ratings-sprite.png Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt Removing koha-tmpl/opac-tmpl/bootstrap/css/jquery.rating.css Applying: Bug 10659: (follow-up) Add plugin information to the about page Applying: Bug 10659: (follow-up) Compiled CSS Using index info to reconstruct a base tree... M koha-tmpl/opac-tmpl/bootstrap/css/opac.css Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/opac-tmpl/bootstrap/css/opac.css CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/css/opac.css Failed to merge in the changes. Patch failed at 0001 Bug 10659: (follow-up) Compiled CSS The copy of the patch that failed is found in: /home/vagrant/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-10659-follow-up-Compiled-CSS-XWX9Pf.patch
With compiled OPAC CSS files, they will always conflict. I'm not sure why we even add them to the bug report. Exclude the last patch when applying, and then run the command to compile the LESS to CSS: https://wiki.koha-community.org/wiki/Working_with_Bootstrap_OPAC_LESS_files
Created attachment 77740 [details] [review] Bug 10659: Upgrade jQuery star ratings plugin This patch replaces our current jQuery star ratings plugin with a newer plugin which will be compatible with newer versions of jQuery: http://antenna.io/demo/jquery-bar-rating/examples/ To test you should have one or more records in your catalog with star ratings. - Apply the patch and set the OpacStarRatings system preference to "results and details" - Perform a search in the catalog which will return one or more titles which have ratings. - Confirm that the ratings appear correctly and the ratings are read-only. - Open the "normal" detail page for that record. - Confirm that the star rating appears correctly. - Test setting and re-setting your star rating. Confirm that it is saved. - Confirm that the "cancel rating" link appears when you have a rating set, and that it disappears after you click it. - Test that the "only details" and disabled options of the OpacStarRatings preference work as they should.
Created attachment 77741 [details] [review] Bug 10659: (follow-up) Add plugin information to the about page This patch updates the about page in the staff client, replacing the information about the jQuery Star Ratings plugin with information about the new jQuery Bar Ratings plugin. To test, apply the patch and go to the about page in the staff client. Confirm that the new information appears correctly.
The sandbox you've requested is not ready. Some problems occurred applying patches from bug 10659: <h1>Something went wrong !</h1>Applying: Bug 10659: Upgrade jQuery star ratings plugin error: Failed to merge in the changes. Using index info to reconstruct a base tree... M koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt M koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt Falling back to patching base and 3-way merge... Removing koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.rating.js Removing koha-tmpl/opac-tmpl/bootstrap/images/star-ratings-sprite.png Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt Removing koha-tmpl/opac-tmpl/bootstrap/css/jquery.rating.css Patch failed at 0001 Bug 10659: Upgrade jQuery star ratings plugin The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run git bz apply --continue. If you would prefer to skip this patch, instead run git bz apply --skip. To restore the original branch and stop patching run git bz apply --abort. Bug 10659 - Upgrade jQuery star ratings plugin 77740 - Bug 10659: Upgrade jQuery star ratings plugin 77741 - Bug 10659: (follow-up) Add plugin information to the about page Apply? [(y)es, (n)o, (i)nteractive] Patch left in /tmp/Bug-10659-Upgrade-jQuery-star-ratings-plugin-4vjbbb.patch .
Created attachment 82760 [details] [review] Bug 10659: Upgrade jQuery star ratings plugin This patch replaces our current jQuery star ratings plugin with a newer plugin which will be compatible with newer versions of jQuery: http://antenna.io/demo/jquery-bar-rating/examples/ To test you should have one or more records in your catalog with star ratings. - Apply the patch and set the OpacStarRatings system preference to "results and details" - Perform a search in the catalog which will return one or more titles which have ratings. - Confirm that the ratings appear correctly and the ratings are read-only. - Open the "normal" detail page for that record. - Confirm that the star rating appears correctly. - Test setting and re-setting your star rating. Confirm that it is saved. - Confirm that the "cancel rating" link appears when you have a rating set, and that it disappears after you click it. - Test that the "only details" and disabled options of the OpacStarRatings preference work as they should. - Confirm that information about the plugin appears on the About page in the staff client, replacing the old star ratings plugin information.
Created attachment 82826 [details] [review] Bug 10659: Upgrade jQuery star ratings plugin This patch replaces our current jQuery star ratings plugin with a newer plugin which will be compatible with newer versions of jQuery: http://antenna.io/demo/jquery-bar-rating/examples/ To test you should have one or more records in your catalog with star ratings. - Apply the patch and set the OpacStarRatings system preference to "results and details" - Perform a search in the catalog which will return one or more titles which have ratings. - Confirm that the ratings appear correctly and the ratings are read-only. - Open the "normal" detail page for that record. - Confirm that the star rating appears correctly. - Test setting and re-setting your star rating. Confirm that it is saved. - Confirm that the "cancel rating" link appears when you have a rating set, and that it disappears after you click it. - Test that the "only details" and disabled options of the OpacStarRatings preference work as they should. - Confirm that information about the plugin appears on the About page in the staff client, replacing the old star ratings plugin information.
Created attachment 84706 [details] [review] Bug 10659: Upgrade jQuery star ratings plugin This patch replaces our current jQuery star ratings plugin with a newer plugin which will be compatible with newer versions of jQuery: http://antenna.io/demo/jquery-bar-rating/examples/ To test you should have one or more records in your catalog with star ratings. - Apply the patch and set the OpacStarRatings system preference to "results and details" - Perform a search in the catalog which will return one or more titles which have ratings. - Confirm that the ratings appear correctly and the ratings are read-only. - Open the "normal" detail page for that record. - Confirm that the star rating appears correctly. - Test setting and re-setting your star rating. Confirm that it is saved. - Confirm that the "cancel rating" link appears when you have a rating set, and that it disappears after you click it. - Test that the "only details" and disabled options of the OpacStarRatings preference work as they should. - Confirm that information about the plugin appears on the About page in the staff client, replacing the old star ratings plugin information.
When I apply the patch, the stars are gone and I have this instead : "Your rating: 3.[X] Cancel rating. Average rating: 3.0 (1 votes)". Am I supposed to see stars again?
Nevermind, just forget I have to call yarn build... I shall continue to check this out.
Created attachment 84903 [details] [review] Bug 10659: Upgrade jQuery star ratings plugin This patch replaces our current jQuery star ratings plugin with a newer plugin which will be compatible with newer versions of jQuery: http://antenna.io/demo/jquery-bar-rating/examples/ To test you should have one or more records in your catalog with star ratings. - Apply the patch and set the OpacStarRatings system preference to "results and details" - Perform a search in the catalog which will return one or more titles which have ratings. - Confirm that the ratings appear correctly and the ratings are read-only. - Open the "normal" detail page for that record. - Confirm that the star rating appears correctly. - Test setting and re-setting your star rating. Confirm that it is saved. - Confirm that the "cancel rating" link appears when you have a rating set, and that it disappears after you click it. - Test that the "only details" and disabled options of the OpacStarRatings preference work as they should. - Confirm that information about the plugin appears on the About page in the staff client, replacing the old star ratings plugin information. Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Hi Owen, this seems to work well overall, but there is one little change to before: When a record has no ratings yet, on the detail page one star shows in yellow by default. Could we change that to be zero stars as before? Stars seem a little bit bigger than before (but nicer icons).
Created attachment 84970 [details] [review] Bug 10659: (follow-up) Ensure zero rating shows correctly This patch makes a minor markup addition to ensure that a title with no rating shows no stars. Also changed: Minor addition to search results JS to prevent unwanted scrolling if the user clicks a star in a star rating.
Created attachment 85010 [details] [review] Bug 10659: Upgrade jQuery star ratings plugin This patch replaces our current jQuery star ratings plugin with a newer plugin which will be compatible with newer versions of jQuery: http://antenna.io/demo/jquery-bar-rating/examples/ To test you should have one or more records in your catalog with star ratings. - Apply the patch and set the OpacStarRatings system preference to "results and details" - Perform a search in the catalog which will return one or more titles which have ratings. - Confirm that the ratings appear correctly and the ratings are read-only. - Open the "normal" detail page for that record. - Confirm that the star rating appears correctly. - Test setting and re-setting your star rating. Confirm that it is saved. - Confirm that the "cancel rating" link appears when you have a rating set, and that it disappears after you click it. - Test that the "only details" and disabled options of the OpacStarRatings preference work as they should. - Confirm that information about the plugin appears on the About page in the staff client, replacing the old star ratings plugin information. Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Created attachment 85011 [details] [review] Bug 10659: (follow-up) Ensure zero rating shows correctly This patch makes a minor markup addition to ensure that a title with no rating shows no stars. Also changed: Minor addition to search results JS to prevent unwanted scrolling if the user clicks a star in a star rating.
Awesome work all! Pushed to master for 19.05
Enhancement, will not be backported to 18.11.x series.
I am getting the following line in the Koha logs on hitting opac-search.pl, I guess it comes from here. File not found : lib/jquery/plugins/jquery.rating.js at /home/vagrant/kohaclone/Koha/Template/Plugin/Asset.pm line 83.
> File not found : lib/jquery/plugins/jquery.rating.js at > /home/vagrant/kohaclone/Koha/Template/Plugin/Asset.pm line 83. I have submitted Bug 22432 for this.