Polls are rendering (before the user votes) with the hyperlinked title just above a duplicate label. Both the title and the label use the same text so it looks pretty goofy in many themes (see attached).

After the user votes, the label text disappears and the poll results page looks like it should.

Comments

AjK’s picture

This is because in page/teaser view the question is also used for the node title (you don't get this when the poll is in a block).

This is probably easily fixed but I'm not sure in what way to fix. If the title isn't the question then the node has no title, thus no link to the node. So I guess surpressing the question in the content area is the way to "fix" this? If so let me know and I'll roll a patch.

regards,
--AjK

kmillecam’s picture

AjK, I believe you're on the right track.

The poll renders correctly as:

1) a block that displays the poll
2) a block that displays the results (bar graph)
3) a node that displays the poll
4) a node that displays the results
5) a node (teaser) that displays the results

but incorrectly as

4) a node (teaser) that displays the poll.

I'm not sure why teasers are treated differently. Maybe you could look at the code that displays the block and mimic that behavior in the node (teaser) code.

Thanks for your help!
Kevin

edmund.kwok’s picture

AjK, try looking at poll_view_voting() function, where $form['choice'] is set. That should be the place to fix then ;-)

AjK’s picture

Status: Active » Needs review
StatusFileSize
new962 bytes

Does this do what you require? Please test and report back.

regards,
--AjK

AjK’s picture

StatusFileSize
new937 bytes

Actually, this patch is a literal "backport" from HEAD that seems to be a simpler solution and does the same thing.

kmillecam’s picture

Works beautifully AjK!

Thanks for the great work.

Kevin

killes@www.drop.org’s picture

Status: Needs review » Fixed

applied to 4.7

Anonymous’s picture

Status: Fixed » Closed (fixed)