Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If a comment is entered with a rating, any user can view that comment once it's published and the stars give the impression that they can be changed since their styling indicates it and if the user clicks on a different star the rating appears to stick to that newly selected star for the duration of the current page load.
Comment | File | Size | Author |
---|---|---|---|
#5 | comments_with_ratings-4.patch | 1022 bytes | Mitriy-Bug |
#4 | v29NEOWh3yqMZA.png | 74.57 KB | Mitriy-Bug |
#3 | comments_with_ratings-2919915-3.patch | 910 bytes | cbildstein |
#2 | comments_with_ratings-2919915-2.patch | 919 bytes | swickham |
Comments
Comment #2
swickham CreditAttribution: swickham at Acro Commerce commentedI didn't spend much time to make sure this was the best way to go about it, but here's a patch that checks to see if the element being created has a value already selected, only the ones with no value selected create stars with the tag that seems to be causing the confusion.
Comment #3
cbildstein CreditAttribution: cbildstein at Acro Commerce commentedTried out the #2 patch but ran into issues in cases where you set a default rating value and the widget would never work in the form because of this check:
if ($select.val() === '-') {
I updated it to check for the form value instead, so the widget would only display when within an actual form where you would need the widget.
if (element.form) {
Seemed to work in my use cases but should be further tested.
Comment #4
Mitriy-Bug CreditAttribution: Mitriy-Bug commentedBut then all the stars are grey and not clear what the rating
Comment #5
Mitriy-Bug CreditAttribution: Mitriy-Bug commentedMade, check. You only need the styles to correct
Comment #6
sorabh.v6None of the patches are working for me. I am using dev-1.x and "reference": "ee888670ec12". I created the rating from the admin account and I am able to change the rating stars as an anonymous user. Though they get reset when I refresh the page.
Comment #7
sorabh.v6Its working, forgot to clear browser cache and browser was using cached js. It's working for me.
Comment #8
StefanRoman CreditAttribution: StefanRoman as a volunteer commentedThis code worked for me
div.fivestar-widget div.on { background-position: 0 -16px; /* RTL */ }
, instead ofdiv.fivestar-widget div.on span { background-position: 0 -16px; /* RTL */ }
. Thanks for it.Comment #9
dbjpanda CreditAttribution: dbjpanda commentedGetting error corrupt patch at line 21 after apply https://www.drupal.org/project/fivestar/issues/2920834
Comment #10
init90Looks like the problem already fixed in current dev release. Thanks, everyone!