Using the cafepress component (admittedly very old and outdated, but the only one of its kind) there is an error reported.
Quote:
Warning: Invalid argument supplied for foreach() in SITEPATH\includes\frontend.php line85
If you change the new outlined below with the old outlined below the error corrects itself.
How it is fixed was mentioned in this post:
http://forum.joomla.org/index.php/topic,66935.0.htmlBelow is the relevant snippets including versioning.
Here is what is in the old 1.0.8 frontend.php:
Code:
* @version $Id: frontend.php 2456 2006-02-18 01:36:30Z stingrey $
/**
* Cache some modules information
* @return array
*/
function &initModules() {
global $database, $my, $Itemid;
if (!isset( $GLOBALS['_MOS_MODULES'] )) {
$query = "SELECT id, title, module, position, content, showtitle, params"
. "\n FROM #__modules AS m"
. "\n INNER JOIN #__modules_menu AS mm ON mm.moduleid = m.id"
. "\n WHERE m.published = 1"
. "\n AND m.access <= '". $my->gid ."'"
. "\n AND m.client_id != 1"
. "\n AND ( mm.menuid = '". $Itemid ."' OR mm.menuid = 0 )"
. "\n ORDER BY ordering";
$database->setQuery( $query );
$modules = $database->loadObjectList();
foreach ($modules as $module) {
$GLOBALS['_MOS_MODULES'][$module->position][] = $module;
}
}
return $GLOBALS['_MOS_MODULES'];
}
/**
Here is the new frontend.php for 1.0.9:
Code:
* @version $Id: frontend.php 3830 2006-06-03 15:53:37Z stingrey $
/**
* Cache some modules information
* @return array
*/
function &initModules() {
global $database, $my, $Itemid;
if (!isset( $GLOBALS['_MOS_MODULES'] )) {
$query = "SELECT id, title, module, position, content, showtitle, params"
. "\n FROM #__modules AS m"
. "\n INNER JOIN #__modules_menu AS mm ON mm.moduleid = m.id"
. "\n WHERE m.published = 1"
. "\n AND m.access <= $my->gid"
. "\n AND m.client_id != 1"
. "\n AND ( mm.menuid = $Itemid OR mm.menuid = 0 )"
. "\n ORDER BY ordering";
$database->setQuery( $query );
$modules = $database->loadObjectList();
foreach ($modules as $module) {
$GLOBALS['_MOS_MODULES'][$module->position][] = $module;
}
}
return $GLOBALS['_MOS_MODULES'];
}
/**
Are there consequences to changing this part of the frontend.php in terms of security or stability?