Star hover does not work when "Allow users to re-vote on already voted content" is checked

Created on 10 September 2020, about 4 years ago
Updated 11 October 2023, about 1 year ago

Hi,

Once the fivestar type field has been created, hovering over the stars no longer works.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France Paulset

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 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.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    Patch Failed to Apply
  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
  • Status changed to Needs work about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    Patch does not apply.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update about 1 year ago
    Patch Failed to Apply
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    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.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    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.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    4 pass, 1 fail
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.2 & MySQL 8
    last update about 1 year ago
    4 pass, 1 fail
  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡Έ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.

Production build 0.71.5 2024