robertDouglass made a good point on #drupal that we need to provide an upgrade path from poll.module if we ever want to provide a true alternative. This will may be tough with polls pre-5.0 because they don't have individual votes from what I remember, just aggregates.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anders.fajerson’s picture

This sounds like it could be developed as a seperate module, it could still be shipped with advpoll though.

ChrisKennedy’s picture

This is an important feature to be implemented if we want to gain drupal "market share". Since Drupal 5 has been out for a long time we can probably not worry much about 4.7 polls that don't have votes. BUT I just now had an idea - if it's a 4.7 poll that doesn't have individual votes, we can just generate the right number of place-holder votes assigned to an anonymous user with IP of 0.0.0.0.

Design of advpoll-convert.module:
* Menu item in the admin/content
* Show a list of poll nodes ala admin/content/node
* Convert selected polls into the appropriate advpoll-binary node {max_choices:1, writeins: 0, runtime -> enddate, use_list: 0 } with all votes moved (or generated) into votingapi_vote, then regenerate cache.

anders.fajerson’s picture

So you want to make it possible to selectivly decide which polls to convert, not just a "click-convert-and-say-goodbuy-to-poll.module"-functionality?

ChrisKennedy’s picture

Assigned: Unassigned » ChrisKennedy
Status: Active » Needs review
FileSize
4.17 KB

Good point, no need to complicate the interface. Here's a patch that converts all poll.module polls via a single button. It doesn't take into account 4.7 polls yet.

anders.fajerson’s picture

Status: Needs review » Needs work

1. Votes added on the edit page ("Votes for choice N:) are not converted on my tests.
2. The body should probably be empty for new binary polls.
3. Some small UI suggestions:
- "X polls successfully converted." (I mean, this is cool!)
- Wrap the Warning text with a warning class to make it stand out and make a note about backuping the database first.
- "Node" is discourage for user facing text...

ChrisKennedy’s picture

Status: Needs work » Needs review
FileSize
5.12 KB

Yeah I'm not a big fan of poll.module's manual vote editing, but I guess we have to support it so that 4.7 polls can be converted. Here's an updated patch that should have everything fixed.

anders.fajerson’s picture

I see, that was the 4.7 thing. Tested and works. The only thing I would add is "messages warning" instead of "warning" as class. Oh, and maybe the mentioning of "node", but you decide about that.

anders.fajerson’s picture

I was going to mention that I'm not a fan of that either (the manual vote editing). Anyway, now we have a (very) unofficial way to manipulate polls, if it comes up again (I think it was in the issue queu some time ago).

ChrisKennedy’s picture

Status: Needs review » Fixed
FileSize
5.1 KB

Oops, I meant to fix the nodes references but I see that I forgot advpoll_convert.info. Fixed, and changed the warning class to "messages warning".

http://drupal.org/cvs?commit=83582

anders.fajerson’s picture

Status: Fixed » Active

Commited to HEAD instead of Drupal-5.

ChrisKennedy’s picture

Status: Active » Fixed

Ahhh I see it was due to the way I edited CVS/Entries. Good call.

http://drupal.org/cvs?commit=83583

Anonymous’s picture

Status: Fixed » Closed (fixed)