warning: Invalid argument supplied for foreach() in /sites/all/modules/phonetic/phonetic.module on line 56.

CommentFileSizeAuthor
#13 warning.patch1.41 KBDraknek

Comments

accessiveapps’s picture

Assigned: Unassigned » accessiveapps

when you did what?

accessiveapps’s picture

Status: Active » Postponed (maintainer needs more info)
darumaki’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

you can close this, warning message no longer appear, must have been a glitch.

ball.in.th’s picture

Title: Warning message » warning: Invalid argument supplied for foreach() in \sites\all\modules\phonetic\phonetic.module on line 56.
Version: 6.x-1.0 » 6.x-1.1
Status: Closed (fixed) » Active

Hi,

I just install version 1.1 and got the same warning on /admin/settings/phoneticfilter .

ball.in.th’s picture

Another warning on page admin/settings/filters/3:
warning: Missing argument 2 for phonetic_help(), called in \sites\all\modules\phonetic\phonetic.module on line 189 and defined in \sites\all\modules\phonetic\phonetic.module on line 9.

hectorplus’s picture

Hello,

I just installed this module and i am getting the same error:

Invalid argument supplied for foreach() in /home/.../public_html/sites/all/modules/phonetic/phonetic.module on line 56.

gfvonb’s picture

This error only happens if the whitelist and/or blacklist is empty.

kirkcaraway’s picture

I have terms in both blacklist and whitelist, and still get same error on the settings page. Any other possibilities? Thanks.

byronveale’s picture

FWIW this error went away for me only after adding terms to both blacklist and whitelist...

accessiveapps’s picture

check if is_array was missing ... fixed for versiom 1.4

accessiveapps’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

Draknek’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new1.41 KB

This was not fixed for me with the latest version.

Attached is a patch that worked.

marcoka’s picture

same here, if i fill in blacklist and whitelist, error is gone

Bill Choy’s picture

The default value for the $blacklist should be an empty array, instead of a empty string.

--- a/www/sites/all/modules/contrib/phonetic/phonetic.module Fri Dec 16 10:17:21 2011 -0500
+++ b/www/sites/all/modules/contrib/phonetic/phonetic.module Mon Dec 19 13:45:26 2011 -0500
@@ -49,7 +49,7 @@

function phonetic_list_add(){

- $blacklist = variable_get('phonetic_blacklist','');
+ $blacklist = variable_get('phonetic_blacklist', array());
$whitelist = variable_get('phonetic_whitelist','');

foreach($blacklist as $word => $meta){
$words .= "$word\n";
}

damienmckenna’s picture

Status: Needs review » Fixed

This bug has been fixed by backporting the code from the D7 branch.

Status: Fixed » Closed (fixed)

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