I'm getting this error message:
Warning: Invalid argument supplied for foreach() in theme_pollfield_formatter_default() (line 203 of /drupal-site/sites/all/modules/pollfield/pollfield.module).

The problem is that Pollfield populates an undeclared array variable, only when translations are active. Later in the code, at line 203, it uses that variable in a foreach iteration. Because I'm not using content translation, that variable isn't set and PHP starts whining.

Since we might as well declare the variable before using it, also to avoid PHP notices, I went ahead and rolled a patch for it.

Comments

tobiassjosten’s picture

Status: Active » Needs review
StatusFileSize
new680 bytes

Actually, this needs to go in before that if statement I placed it in. Here's the correct and working patch.

NeoID’s picture

Now giving me:

Illegal offset type i /.../taxonomy.module på linje 607.
Illegal offset type in isset or empty i /.../taxonomy.module på linje 1039.

tobiassjosten’s picture

Are you sure this is because of my patch? I can't see the connection.

bryan kennedy’s picture

Status: Needs review » Fixed
Issue tags: +foreach()

Noticed here as well. http://drupal.org/node/904424

Now fixed in the latest dev.
http://drupal.org/node/904424

Thanks for your patches. Credit given in the commit.

Status: Fixed » Closed (fixed)
Issue tags: -foreach()

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