some php error
LindenLion - June 15, 2008 - 12:09
| Project: | Taxonews |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi I'm not a coder, so don't know what the problem is. This is the error that comes up. Could be caused because I only have one vocabulary yet with no terms?! Cheers, Michael
warning: Invalid argument supplied for foreach() in /var/www/d/sites/all/modules/taxonews/taxonews.module on line 426.
if (count($terms) == 0)
{
$sq = 'SELECT td.tid, td.name '
. 'FROM {term_data} td '
. 'WHERE td.vid = %s '
. 'ORDER BY 2, 1 ';
$vids = variable_get(Taxonews::VAR_VOCABULARY, 0);
foreach ($vids as $vid) // line 426
{
$sq = 'SELECT td.tid, td.name, v.name as vocabulary_name '
. 'FROM {term_data} td '
. 'INNER JOIN {vocabulary} v ON td.vid = v.vid '
. 'WHERE td.vid = %s '
. 'AND td.vid = v.vid '
. 'ORDER BY 2, 1 ';
$q = db_query($sq, $vid) ;
while ($o = db_fetch_object($q))
{
$terms[] = $o;
}
}
}
return $terms ;
}
#1
Hi,
Thanks for your message. This bug was found and fixed in the 5.x-1.1-rc revision.
Please upgrade to that release candidate or the latest 5.1-1.x-dev: it should remove your problem.
#2
Automatically closed -- issue fixed for two weeks with no activity.