Autre bug survenu suite au bug précédent :
Code PHP:
Warning: Invalid argument supplied for foreach() in /global.php(233) : eval()'d code on line 90
Cette erreur survient après avoir renseigné le champ module à la main de la table template. Elle s'apparente au module dans style_fetch.
Code original du module :
Code PHP:
if (THIS_SCRIPT == 'portal_index')
{
$page_options_cache = $page_options_cache["$PAGE_TITLE"];
$vbfp_perms = $vbfp_perm_cache["$PAGE_TITLE"];
// on récupère l'id du style attribué à cette page
if ($page['styleid'] != 0)
{
$styleid = $page['styleid'];
}
$module_in_page = array();
$template_in_page = array();
$module_name_array = array();
$special_in_page = array();
if ($pagecache_exp["$PAGE_TITLE"]["$styleid"]['expert'] == 1)
{
define('EXPERT_MODE', 1);
$PAGE_STYLEID = $styleid;
if (!empty($pagecache_exp["$PAGE_TITLE"]["$styleid"]['modules']))
{
foreach ($pagecache_exp["$PAGE_TITLE"]["$styleid"]['modules'] AS $module_name)
{
if ($vbfp_perms["$styleid"]["$module_name"]['canview'][$vbulletin->userinfo[usergroupid]] == 1)
{
$module = preg_replace('/^(.+?)(_\d+?|)$/', '\\1', $module_name);
if (!in_array(trim($module), $module_in_page))
{
$module_in_page[] = trim($module);
// les templates
foreach ($modulecache["$module"]['templates'] AS $template)
{
$template_in_page[] = $template;
}
// les templates autre
if ($modulecache["$module"]['othertemplates'] != '')
{
$other_tmp = explode(',', $modulecache["$module"]['othertemplates']);
foreach ($other_tmp AS $other)
{
$template_in_page[] = $other;
}
}
// les templates spéciaux
if ($modulecache["$module"]['specialtemplates'] != '')
{
$special_tmp = explode(',', $modulecache["$module"]['specialtemplates']);
foreach ($special_tmp AS $special)
{
$special_in_page["$module_name"][] = "'" . trim($db->escape_string($special)) . "'";
}
}
}
$module_name_array["$module_name"] = $module;
}
}
}
}
else
{
if (is_array($page['modules']))
{
$PAGE_STYLEID = 0;
foreach ($page['modules'] AS $colonne => $tmp1)
{
foreach ($tmp1 as $module_name)
{
if ($vbfp_perms[0]["$name"]['canview'][$vbulletin->userinfo[usergroupid]] == 1)
{
$module = preg_replace('/^(.+?)(_\d+?|)$/', '\\1', $module_name);
if (!in_array(trim($module), $module_in_page))
{
$module_in_page[] = trim($module);
foreach ($modulecache["$module"]['templates'] AS $template)
{
$template_in_page[] = $template;
}
if ($modulecache["$module"]['othertemplates'] != '')
{
$other_tmp = explode(',', $modulecache["$module"]['othertemplates']);
foreach ($other_tmp AS $other)
{
$template_in_page[] = $other;
}
}
if ($modulecache["$module"]['specialtemplates'] != '')
{
$special_tmp = explode(',', $modulecache["$module"]['specialtemplates']);
foreach ($special_tmp AS $special)
{
$special_in_page["$module_name"][] = "'" . trim($db->escape_string($special)) . "'";
}
}
}
$module_name_array["$module_name"] = $module;
}
}
}
}
}
$globaltemplates = array_merge($globaltemplates, $template_in_page);
unset($module_name);
// on recupère les options importantes de la page
if (is_array($page_options_cache["$PAGE_STYLEID"]['vbfp']))
{
foreach($page_options_cache["$PAGE_STYLEID"]['vbfp'] AS $varname => $value)
{
$vbfp_options["$varname"] = $value;
}
}
}
La ligne 90 est la suivante :
Code PHP:
$template_in_page[] = $other;
(deuxième apparition).
Je trouve pas la correction à part désinstaller et reinstaller le portail... Bug visible actuellement sur vb-fr.