- First commit to issue fork.
- π¨π³China wqmeng
Hello
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.
- last update
about 1 year ago Patch Failed to Apply - Status changed to Needs review
about 1 year ago 11:22pm 23 September 2023 - Status changed to Needs work
about 1 year ago 12:49am 27 September 2023 - last update
about 1 year ago Patch Failed to Apply - last update
about 1 year ago 4 pass - @wqmeng opened merge request.
- π¨π³China wqmeng
The 15# patch is the same as the 18# in git repository, not sure why 15# does not apply.
- πΊπΈUnited States tr Cascadia
Patch 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.
- last update
about 1 year ago 4 pass, 1 fail - π¨π³China wqmeng
There 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
- π¨π³China wqmeng
Here is another patch file, which could patch to the fivestar lasted 8.x-1.0-alpha5 correctly.
Thanks. - last update
about 1 year ago 4 pass, 1 fail - last update
about 1 year ago 4 pass, 1 fail - Status changed to Needs review
about 1 year ago 9:39pm 11 October 2023 - πΊπΈUnited States tr Cascadia
If 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.
The last submitted patch, 22: fivestar-3170189-vote-in-comment-star-hover-2.diff, failed testing. View results β
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.