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.
Hi,
Once the fivestar type field has been created, hovering over the stars no longer works.
Comment | File | Size | Author |
---|---|---|---|
#22 | fivestar-3170189-vote-in-comment-star-hover-2.diff | 3.92 KB | wqmeng |
#15 | fivestar-3170189-vote-in-comment-star-hover.patch | 4.27 KB | wqmeng |
Issue fork fivestar-3170189
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
TR CreditAttribution: TR commentedPlease be more explicit. As far as I can tell, hovering over the stars works the same as it did in D7.
Comment #3
Paulset CreditAttribution: Paulset commentedIn the content creation form (vote when editing), hovering over stars no longer works, so it is not possible to assign a rating.
Comment #4
TR CreditAttribution: TR commentedAgain, this works fine for me. Here's what I did:
Then,
All of this is working properly as far as I can tell. I cannot find an error here, but again you have still not given much information about how to reproduce the error.
Comment #5
Paulset CreditAttribution: Paulset commentedI found the problem.
Configure the module as usual, with a field of type fivestar, and "Rating while editing".
Uncheck "Allow users to re-vote on already voted content", check "Set voting target" and configure as usual.
When you try to create an Article with a fivestar type field, it is not possible to vote (the hovering hover stars does not work), without even having entered or not the reference entity that will receive the vote.
When we check "Allow users to re-vote on already voted content", it works.
Comment #6
Paulset CreditAttribution: Paulset commentedComment #7
Paulset CreditAttribution: Paulset commentedComment #8
brandonratz CreditAttribution: brandonratz as a volunteer commentedComing over from https://www.drupal.org/project/fivestar/issues/3193203#comment-13998505
I reproduced the same issue as #5. I am unable to vote with "Allow users to re-vote on already voted content." checked. I have not used the "Set Voting Target" setting.
Comment #9
TR CreditAttribution: TR commentedComment #10
TR CreditAttribution: TR commentedComment #11
TR CreditAttribution: TR commentedClosed #3228911: Can't vote when revote option is disabled as a duplicate. Reviewers should verify that any patches in this issue also fix that one.
Comment #12
Paulset CreditAttribution: Paulset commentedWith the patch it is now possible to vote, however, it is also possible to vote again even if vote again is unchecked (with voting target).
So I close this issue and therefore create another one.
Comment #13
TR CreditAttribution: TR commentedNo patch has been committed, or even posted in this issue. So this can't be called fixed.
Comment #15
wqmeng CreditAttribution: wqmeng commentedHello
I submitted a commit to the fivestar-3170189, to fix the fivestar field added to the comment type, and then add the comment to the content type, When you dis-select the "Allow users to re-vote on already voted content" option, the fivestar star hover still active when a user who have already submitted a vote in a previous comment.
How to,
1. Add a comment type such as comment_with_fivestar
2. Add a fivestar field such as field_rating to the above comment type.
a) Select: Rated while editing
b) Enable: Set voting target,
c) Target bridge field: entity_id
d) Target fivestar field: field_rating (this field will need to add to content type movie_review below separately)
e) Disable: Allow users to re-vote on already voted content.
3. Add a content type movie_review, add a comment_with_fivestar comment field to this content type. Add a fivestar field named field_rating same as above 'Target fivestar field' to movie_review.
a) Select: Rated while editing
b) Disable: Set voting target
c) Enable comment of movie_review content type.
4. Create a movie_review node: Movie-A-review
On Movie-A-review node, add a new comment and select the stars to vote and then submit the comment.
Result:
Movie-A-review should show the average rating result in the field_rating added to the Node.
The comment should show the rating of the user.
The star hover should be de-activated if a user have already voted.
I added this in the 8.x-1.0-alpha3+9-dev with a few patches on the Drupal Version 10.1.4-dev, think it should work in D8, and D9 also.
If I have something errors, please let me know.
A patch file added also,
Thanks.
Comment #16
TR CreditAttribution: TR commentedComment #17
TR CreditAttribution: TR commentedPatch does not apply.
Comment #19
wqmeng CreditAttribution: wqmeng commentedThe 15# patch is the same as the 18# in git repository, not sure why 15# does not apply.
Comment #20
TR CreditAttribution: TR commentedPatch in #15 failed to apply because there is no end-of-line character at the end of the file. The MR looks correct. A diff of the two files will show this missing character.
Why do you have to have a special case for comment entities? Doesn't it happen for any entity type if you're voting on the target?
We need a test case for this. The test case should fail without the patch, demonstrating that there is a problem. The test case should pass when the patch is applied, demonstrating that the patch fixes the problem. The test case also prevent us from breaking this again in the future when other changes are made to this code.
Comment #21
wqmeng CreditAttribution: wqmeng commentedThere is no need to limit the entity type to be comment, while I do not know if there is other case that we need to add a fivestar field to another entity type such as Taxonomy that we vote to Taxonomy item when view it and then submit the vote to the parent content node? If there is a case that we can work with, we could remove this entity type check.
I tried to merge the conflict of this patch to 8.x-1.x, as the old patch file can not patch to 8.x-1.0-alpha5. Hope I do correct.
Thanks
Comment #22
wqmeng CreditAttribution: wqmeng commentedHere is another patch file, which could patch to the fivestar lasted 8.x-1.0-alpha5 correctly.
Thanks.
Comment #23
TR CreditAttribution: TR commentedIf you set the issue status to "Needs review" the patch will be automatically tested and it signals to people watching this issue that there is a new version of the patch to look at.