I need to import about 9k votes. I have tried 10-15 different approaches but not the right one. I have tested the import with both Rate and Fivestar modules. I am importing directly in to the "votingapi_vote" table in MySQL. Here's what I think needs to happen but I have not successfully accomplished it:

1. Import records in to votingapi_vote
2. Rebuild data in votingapi_cache

I have tried manually creating the records in votingapi_cache but it looks like they need to be programmatically created.

I've tried running "drush vcalc", tried setting the Voting API to "Tally results at cron-time", then import and run cron, etc.

The only way I can get the new records to populate in votingapi_cache and display properly is to import the record and then go to the entity/node page and add a new vote (fivestar/thumb up/whatever) and votingapi_cache populates with the new and imported votes. This process won't work for 9k votes. :)

Please help. I must be missing something simple. Feeds isn't helping.
I have also looked through a D6 fix but would need help porting to D7: #382866: provide script and documentation to rebuild the votingapi cache

CommentFileSizeAuthor
#1 votingapi-drushvcalc-1399800.patch393 bytesccamporeale

Comments

ccamporeale’s picture

StatusFileSize
new393 bytes

I got drush vcalc to work by making the following change to votingapi.drush.inc:

votingapi_recalculate_results($entity_type, $entity_id, TRUE);

should be

votingapi_recalculate_results($vote['entity_type'], $vote['entity_id'], TRUE);

mmilo’s picture

Status: Active » Reviewed & tested by the community

Works for me!

torotil’s picture

Category: support » bug
Status: Reviewed & tested by the community » Fixed

Thanks. The patch has been committed to the 7.x-2.x branch.

Status: Fixed » Closed (fixed)

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