Hi quicksketch, I have the disappearing content issue again. Went through the other issues but nothing there seemed to be a solution for this case.

As an everlasting newby I am trying to port our old site to D6 at new.globalopinion.eu trying to maintain as much of the former functionality as possible. There was some custom coding to show the result-block in a different way, and the pro-con module is integrated.
And unfortunately we now have what others had before, content (question) disappears after voting, although the results do appear. This happens both in teaser as in node. First I thought maybe some influence by the tweet, and facebook buttons, but they don't appear on the teaser so I discarted that. Same goes for pro-con content. Only the rating on the poll itself appears on the teaser.
After refresh everything is ok. Page compression, block cache and optimize javascript are enabled (somewhere you talk about enabling "all" caches, what/where's that?)

I Include screenshots with the firebug windows open: before voting, after voting and after refresh after voting. You can see that the divs for content after voting simply don't appear... Any suggestions? You can also try for yourself if you want.

By the way, without ajax poll installed, we had a problem on the teaser page. Votes went to the first item in the list instead of the poll you voted on (say 4th poll). So there was already something strange there. This behaviour has disappeared with ajax poll.

By the way II - there does seem to be some js problem on the site: js directories or files seem not to be created (sometimes...) and when updating a view I get this blank page with a lot of text/coding instead of remaining/going back to the view-edit form, so there I have to hit "back" to be able to save. And then the changes turn out to have been executed. Don't know what to do with that either, but it's kinda working.

tnx

Comments

suffering drupal’s picture

Title: Question disappears on vote submit again » Question disappears on vote submit (again)

Hi quicksketch, I already thought so, but http://drupal.org/node/1031258#comment-4329948 seems to confirm that some DIV disappears, which is actually what you can see in firebug. But where should I look to see why this happens, and how to solve?
tnx

guypaddock’s picture

Version: 6.x-1.1 » 7.x-1.1
Component: User interface » Code
Status: Active » Needs review
StatusFileSize
new1.19 KB

This happens in the Drupal 7 version as well. The issue is that the JavaScript replaces the content of the div with the ".content" class on it, but Drupal doesn't render the full node content to replace what's there. As a result, the div only gets populated with the poll-specific content, instead of the full node content. So, if you have any custom fields or field order, or have any links, those items get lost after the AJAX post-back.

As a fix, I've adjusted the JavaScript to inject a wrapper div around just the poll-specific elements of the HTML that we want to replace, and then modified the logic to just replace those pieces. Normally, the wrapper would be added by the form builder and/or theme logic, but since this module extends core Poll support, we don't quite want to take on re-themeing the whole thing just to get an appropriate wrapper.

In local testing, this appears to work quite well, but I'm marking this NR.

Hopefully the solution (or something similar) will work for Drupal 6 as well.

This patch is sponsored by VoterVillage.com and RedBottle Design (redbottledesign.com).

guypaddock’s picture

This time with correct line endings...

BrockBoland’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Category: support » bug
Status: Needs review » Reviewed & tested by the community

Patch in #3 applies cleanly and fixes the problem!

One bit of touchup (but I didn't want to submit a new patch and leave this sitting in "needs review" some more); there's some trailing whitespace on the patch.

quicksketch’s picture

Hi thanks guys! It's been ages since I was in this queue. I'll commit this next time I'm working on patches here. I'm guessing this is for D7 only?

BrockBoland’s picture

The patch is. I haven't tested D6 to see if the bug exists there.

sgdev’s picture

Really would like this patch committed. There are 3 other patches all trying to do the same thing.

https://www.drupal.org/project/ajax_poll/issues/1048064
https://www.drupal.org/project/ajax_poll/issues/1368064
https://www.drupal.org/project/ajax_poll/issues/2662538

I don't care which approach is selected, just that one of them should be chosen and added, so a baseline exists for other patches.