In index.php (around line 99) a value of 99999999 gets assigned to $Itemid if none is found:
Code: Select all
if ( !$Itemid ) {
// when no Itemid give a default value
$Itemid = 99999999;
}
Code: Select all
// checking if we can find the Itemid thru the content
if ( $option == 'com_content' && $Itemid === 0 ) {
$id = intval( mosGetParam( $_REQUEST, 'id', 0 ) );
$Itemid = $mainframe->getItemid( $id );
}
/** do we have a valid Itemid yet?? */
if ( $Itemid === 0 ) {
/** Nope, just use the homepage then. */
$query = "SELECT id"
. "\n FROM #__menu"
. "\n WHERE menutype = 'mainmenu'"
. "\n AND published = 1"
. "\n ORDER BY parent, ordering"
;
$database->setQuery( $query, 0, 1 );
$Itemid = $database->loadResult();
}
The solution to this is simple. Just move the first snippet of code to below the second if condition (I moved it to line 127). This causes the $Itemid to be set correctly and solve my problem (and maybe/probably other problems as well).
I hope I described this clearly. If needed, I can provide a diff file.
Best regards,
Robert Jonker