Votes are created when they should not

Created on 17 June 2020, about 4 years ago
Updated 17 May 2024, about 1 month ago

How to reproduce

  • Create a content type
  • Add Fivestar field to it with ("rated_while" => "viewing") or ("rated_while" => "editing", "allow_ownvote" => false)
  • Create node of that type

Result: vote is created owned by author

Expected result: no vote is created

  • Set "rated_while" to "viewing"
  • Edit the node as another user, e.g. administrator

Result: vote is created owned by user who edited the node

Expected result: no vote is created

Proposed resolution

Modify Drupal\fivestar\Plugin\Field\FieldType\FivestarItem::postSave() to check whether vote should be created.

When a user edits a content having a Fivestar field with rated while viewing setting, a vote is created on behalf of that user.

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡ΎCyprus Alex Bukach

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.

Production build 0.69.0 2024