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

stano.lacko created an issue. See original summary.

pifagor’s picture

Status: Active » Closed (outdated)