Strict typing and fluent interface for Vote entity

Created on 25 February 2025, 3 months ago
πŸ“Œ Task
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

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

Merge Requests

Comments & Activities

  • Issue created by @tr
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    Also for related types like VoteType and VoteStorage.
    VoteResultFunction plugins and manager will be handled in a separate issue.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    I guess I don't have a choice, VoteResultFunction plugins are too intertwined, so have to work on the typing in those at the same time it seems.

  • Pipeline finished with Skipped
    3 months ago
    #434265
    • tr β†’ committed ef653008 on 4.0.x
      Issue #3509000 by tr: Strict typing and fluent interface for Vote entity
      
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
  • Here's the log with rate module after this merged.

    TypeError: Drupal\votingapi\Entity\Vote::setValue(): Argument #1 ($value) must be of type float, null given, called in /var/www/html/d11site/web/modules/contrib/rate/src/Plugin/RateWidgetBase.php on line 316 in Drupal\votingapi\Entity\Vote->setValue() (line 92 of /var/www/html/d11site/web/modules/contrib/votingapi/src/Entity/Vote.php).
    
    ArgumentCountError: Too few arguments to function Drupal\votingapi\Entity\Vote::setValue(), 0 passed in /var/www/html/d11site/web/modules/contrib/rate/src/Plugin/RateWidgetBase.php on line 316 and exactly 1 expected in Drupal\votingapi\Entity\Vote->setValue() (line 92 of /var/www/html/d11site/web/modules/contrib/votingapi/src/Entity/Vote.php).
    

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    That appears to be the Rate module calling the Vote API with a missing argument. That's a bug in Rate, which was revealed the above changes.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024