Would be nice to have a votingapi handler, just like we have a flag one :)

Attaching one. Totally untested. Planning to give it some more love tomorrow.
As you can see, it recalculates the voting results only after the import/rollback is done, for better performance.

Wasn't sure whether to support migrating to all content types (as it is now), or to accept the content type in the constructor and limit to that one only.
(In any case, if it's missing, we assume the default, which is "node").
And if the content type is in the constructor, is it then listed in fields()?

Let me know your thoughts.

CommentFileSizeAuthor
#1 votingapi.inc_.txt4.47 KBbojanz
votingapi.inc_.zip1.15 KBbojanz

Comments

bojanz’s picture

StatusFileSize
new4.47 KB

Huh. Forgot about this one.
Attaching a working version.

moshe weitzman’s picture

Status: Needs review » Fixed

Committed to D6 and D7. I did not test this yet, but I will. I commented out a little code in bulkRollback which looked wrong. Also, we should ideally use votingapi_delete_votes(). I implemented that for D7 but did not touch D6. Is there a reason that you did not do that?

bojanz’s picture

To be honest, I no longer remember. It was written for a D6 project that got launched at the beginning of february...

Status: Fixed » Closed (fixed)

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