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
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | votingapi-drushvcalc-1399800.patch | 393 bytes | ccamporeale |
Comments
Comment #1
ccamporeale commentedI 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);
Comment #2
mmilo commentedWorks for me!
Comment #3
torotil commentedThanks. The patch has been committed to the 7.x-2.x branch.