Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
poll.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Feb 2009 at 11:07 UTC
Updated:
8 Dec 2010 at 09:57 UTC
Jump to comment: Most recent file
Comments
Comment #1
drummCan not reproduce with Garland. What theme are you using?
Comment #2
AmrMostafa commentedThis happens because of #154859: Document that cached entity objects are not necessarily cloned any more and I can reproduce it with HEAD, with Garland.
See attached screenshot.
To reproduce:
/nodewith that poll promoted to front page.A patch for HEAD is attached. I've to say, I hate that patch. I believe the right fix is to get this fixed: #154859: Document that cached entity objects are not necessarily cloned any more
Comment #3
AmrMostafa commentedComment #4
pp commentedI reviewed the patch. It's good, and kill the bug.
I suggest write test for this bug.
Comment #5
stella commentedI've merged in #453554: Poll block is always rendered as the node one line patch fix into this one since they appear to be inter-dependent. It removes an obsolete parameter which was causing the block to be rendered with the page layout.
There were too many tests missing, so I opened a separate ticket for them in #474308: poll module - new simple tests.
Cheers,
Stella
Comment #6
stella commentedComment #7
pp commentedWhat the hell. I couldn't review the patch. My computer (with which I reviewed it earlier) is dead. This computer has "PHP Version 5.2.4-2ubuntu5.6" but bug isn't presents. I don't understand.
I saw the poll.module and node.module (node_load) in the current code and I didn't saw changes. I saw the CVS messages. I found one relevant patch #474302: Poll module fixes - due to recent api changes It has not any relevant changes.
Anybody reproduce this bug with the new CVS Drupal release?
pp
Comment #8
stella commentedI can still reproduce a problem with the latest HEAD, but it's a bit different - I get content in both areas, it's just incorrect content.
Without the changes in the patch, the block gets the page view, e.g. it contains the 'add new comment' link.
If you only include the poll_view() line api fix, then there's still an issue. The block still contains the 'add new comment' link, and the node doesn't contain the 'cancel your vote' button.
Comment #9
stella commentedPatch rewrite.
The poll module was using poll_view() for generating the node content and the block content, which meant supplying an extra param to poll_view() to identify it was using it for a block, rather than a node page. It also called poll_view() directly. After a discussion on IRC with catch, we thought it might be better to split this function, so this patch is a first draft of this. The patch also moves the cloning into
poll_block_latest_poll_view().Cheers,
Stella
Comment #10
pp commentedI see. If I click "Add new comment" link the block content will bee empty.
The patch resolve this problem.
Comment #11
catchPatch looks good to me too. Poll adding an extra param to it's implementation of hook_view() then calling it directly, when it's one of about three implementations of hook_view() in the entire CVS repository doesn't set a good example IMO. Two distinct functions is better, and there's no serious code duplication by splitting them out.
Comment #12
webchickCould we flesh that comment out a bit? I'd rather drop the reference to the URL and instead explain inline why we do this.
Other than that this looks fine. The duplicated code sucks a bit, but I agree that the fewer weirdo conventions we introduce (especially in Poll module :P), the better off we are.
Comment #13
stella commentedComment #14
catchThat comment is a lot better.
Comment #15
webchickCommitted to HEAD. Thanks!
Now let's get those tests in there. :D