Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I've just upgraded my drupal website from 5.8 to 5.15. I noticed after running the site again that the poll result are not displayed in the node pages "node/111" but they are in the sidebar block !! ...
how could this happen.
I tried replacing the poll.module with the old one but nothing changed.
<div class="node node-poll" id="node-5703">
<div class="info"> submitted by <a title="view profile" href="/user/3">Dr.Abody</a> on Wed, 11-2-2009</div>
<div class="content"/>
<div class="links"><ul class="links inline"><li class="first last statistics_counter"><span class="statistics_counter">552 reads</span></li>
</ul></div>
</div>
There's nothing in the content div element but the links !!!
Comment | File | Size | Author |
---|---|---|---|
#13 | poll_node_block_fixes.patch | 4.17 KB | stella |
#10 | What You see, if you search the bug. | 29.57 KB | pp |
#9 | poll_node_block_fixes.patch | 3.97 KB | stella |
#5 | poll_node_block_fixes.patch | 1022 bytes | stella |
#2 | Poll.png | 51.78 KB | AmrMostafa |
Comments
Comment #1
drummCan not reproduce with Garland. What theme are you using?
Comment #2
AmrMostafa CreditAttribution: 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:
/node
with 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 CreditAttribution: AmrMostafa commentedComment #4
pp CreditAttribution: pp commentedI reviewed the patch. It's good, and kill the bug.
I suggest write test for this bug.
Comment #5
stella CreditAttribution: 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 CreditAttribution: stella commentedComment #7
pp CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: stella commentedComment #14
catchThat comment is a lot better.
Comment #15
webchickCommitted to HEAD. Thanks!
Now let's get those tests in there. :D