This is Drupal 6.6. I installed AP and adjusted user permissions to allow voting. The poll displays without options nor anywhere to click to vote.

I'm getting this error on one of my pages:
warning: Invalid argument supplied for foreach() in /home/adrkitsap/drupal-6.6/sites/all/modules/advpoll/advpoll.module on line 275.

I don't even know where to begin troubleshooting this one. Just wanted to report it so you'll know how the 6.x port is doing.

Comments

alan426’s picture

Never mind ... I had set an expiration date. Poll is displaying properly, however, I'm still getting the "Invalid argument" warning on certain pages.

alan426’s picture

Priority: Critical » Minor
alan426’s picture

More info. Here's what's in the module , beginning line 273:

function _advpoll_writeins_access($node) {
user_access('administer polls');
foreach ($node->choice as $choice) {
if ($choice['writein']) {
// Has at least one write-in choice.
return TRUE;
}
}
return FALSE;
}

$node->choice is not defined in this context. Putting an if ($node->choice) {} around the foreach loop clears the error.

alan426’s picture

Title: Poll results missing from node » Invalid argument ... foreach() line 275 (was Poll results missing from node)
Walt Esquivel’s picture

I received a similar error today:

warning: Invalid argument supplied for foreach() in /home/.directory_abc/directory_xyz/mysite.com/sites/all/modules/advpoll/advpoll.module on line 275.

I'd rather not mess with the code so I'll wait for the code fix. Thanks.

ChrisKennedy’s picture

Priority: Minor » Normal
Status: Active » Postponed (maintainer needs more info)

What pages and poll types does this occur on? What actions trigger it?

Navinjohnson’s picture

For me it happens on every node page with user generated content that you navigate to. Not just polls.

davidcomelli’s picture

warning: Invalid argument supplied for foreach() in /home/a2425063/public_html/sites/all/modules/advpoll/advpoll.module on line 275.

I'm getting this same error when I go directly to a page node and a picture node.

No other places is this error showing up for me.

georgedamonkey’s picture

For me, it appears on every page.

davidcomelli’s picture

Installed the update today
Drupal 6.8 Advanced Poll 6.x-1.x-dev (2008-Dec-30)

Still getting the problem with I'm looking at the Individual nodes. Any Ideas?

ChrisKennedy’s picture

Status: Postponed (maintainer needs more info) » Needs review

Okay I think I fixed it. If you check out the latest code from CVS or get the new build tomorrow it should work.

Navinjohnson’s picture

Works for me on all pages, Chris. Thanks!

ChrisKennedy’s picture

Status: Needs review » Fixed

Schweet.

Status: Fixed » Closed (fixed)

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