Closed (fixed)
Project:
Advanced Poll
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Aug 2009 at 08:48 UTC
Updated:
19 Jan 2011 at 10:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
ChrisKennedy commentedHmm I haven't used the views integration code - just committed the patch for another developer that requested it. I'm not sure what the best way to fix this would be - changing the content type from advpoll to node seems like a big pain to fix everywhere, although maybe it's easiest than #2.
Comment #2
SuperContraXTC commentedI am also trying to relate Views relationship with Advance Poll but I can not do it.
Comment #3
reubenavery commentedThe question I would pose is why does advpoll need a content type other than 'node'? Are advpolls to be considered differently than nodes?
Comment #4
stinky commentedsubscribe
Comment #5
stinky commentedsubscribe
Comment #6
Vector- commentedEDIT: Well... I initially had a big long post here about hacking this to work... but really I was just having some issues with Views caching... hehe, fun!
Anyhow, views integration with a current version of VotingAPI was quite easy, though there's a bit to know...
Using hook_votingapi_relationships() gets the content_type issue fixed - by adding a copy of the relationships 'Node: Vote results' and 'Node: Votes' for use with Advanced Poll data (with a minimal description denoting such), but VotingAPI's relationships don't know about the values AdvPoll puts in the 'function' field through this implementation...
Luckilly you can select Other and use the 'option-#', 'total_votes' (etc, didn't look farther) that AdvPoll saves
The hook_votingapi_relationships (add to advpoll.module ?):
Comment #7
ntg commentedSubscribing
Comment #8
elstudio commentedI've attached a patch that improves views2 integration for advpoll.
It does two things:
* Provides Vector's code so that views2 recognizes advpoll data
* Allows printing of choice label for advpoll binary nodes. I've done this by adding a formatter for a vote's value. (Ideally, it should be on the tag, not the value -- but votingapi doesn't implement hooks for tags right now.)
Please review!
Comment #9
miro_dietikerI'm happy to see this a little improved.
Please review and i'll commit any progress on this.
Comment #10
miro_dietikercommitted to cvs after review.
thanks for your contribution.