It seems that the solution of #609768: (Un)publishing content containing a pollfield from admin/content/node throws an error and deletes all pollfield settings introduced a new issue. This is my guess but of course this could be caused by any other change in the dev since I was using 1.6 before.

If my pollfield has three choices and I only use two of them, the empty field shouldn't be displayed. That was the way it worked before but take a look at the attached pic and you see what changed.

CommentFileSizeAuthor
#6 patch_610442.patch663 bytesburningdog
devbug pollfield.png7.94 KBdddave

Comments

mario_prkos’s picture

Did you create new poll or this is a old one? This bug is referred to fact that serialization of fields is not done properly and wrong data is put in database. I have the same copy of dev version on my laptop and I created new poll and try published unpublished stuff and did not find any problem. Then I tried another one with same success. Can you try recreate poll then check it out if you have same problem you can post what did you do so I can reproduce it.

Thanks for your effort. This will be best tested module in drupal :).

dddave’s picture

Ok, did some testing of this.

First of all, this is no longer about un/republishing content. You were also right that creating a new poll works well and empty fields don't show.

BUT: Any editing of the pollfield settings (e.g.: changing the text of a choice, disallow that results are shown etc.) makes the empty field appear.

I tested this with a couple of scenarios/settings and it really narrows down to the bogus handling of node editing.

Wayne Ashley’s picture

Hi,

I resolved this problem by replacing the following lines

if (!empty($choices)) {
foreach ($choices as $delta => $choice) {
$list[$delta] = check_plain($choice['choice']);
}

//choose form for specific type of poll

WITH

if (!empty($choices)) {
foreach ($choices as $delta => $choice) {
if (!empty($choice['choice'])){
$list[$delta] = check_plain($choice['choice']);
}
}

//choose form for specific type of poll

Don't know if this is the best way to go about fixing the issue, but hopefully will help point to it's cause.

oxigen’s picture

Wayne, this patch fixed this issue. Thanks a lot.

mario_prkos’s picture

Thank you for your contribution Wayne, this patch will be included i dev version and will be included in next release.

burningdog’s picture

Status: Active » Fixed
StatusFileSize
new663 bytes

The fix worked for me too - I've rolled a patch in case someone needs to apply it before the next release.

dddave’s picture

Patch works well. Looking forward to the new release.

Thx!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.