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.
In votingapi_set_votes() when $votes['entity_id'] is '0' it generates Fatal error on $tmp = $vote + votingapi_current_user_identifier();
When anonymous is voting, than assign $votes to array() is not correct.
if (!empty($votes['entity_id'])) {
$votes = array($votes); // Not run when $votes['entity_id']=0
}
After change:
if (!empty($votes['entity_id']) || !empty($votes['entity_type'])) {
$votes = array($votes);
}
Now tt works correct.
Comments
Comment #2
pifagor