SoBiPro - problems with ItemID in Alphabar

You might experienced this, the links in the Alphabar are sometimes misbehaving, the module assignments in the resulted pages are gone off, if you have some fancy module to menu associations set in your SoBiPro powered site. Obviously, this is an ItemID handling problem, and, unfortunately can be fixed only with a core hack.

Don't worry, is not a complicated thing, but is a core hack - so do a backup before you try to perform it, and be aware, that will be wiped out on next upgrade.

The line-numbers below are applied for SoBiPro version 1.1.2, but the hack is the same - and works - on the 1.1.3 too (The latest version as I wrote this).

So, backup everything, then locate this file:

/components/com_sobipro/lib/cms/joomla_common/base/mainframe.php

Locate this code in the file (around line 619):

protected function getItemid( &$url )
    {
        $sid = isset( $url[ 'pid' ] ) && $url[ 'pid' ] ? $url[ 'pid' ] : $url[ 'sid' ];
        if ( !( ( int )$sid ) ) {
            return false;
        }
        $url[ 'Itemid' ] = 0;

And replace it with this:

protected function getItemid( &$url )
    {
        $ItemID=JRequest::getInt('Itemid');
        $sid = isset( $url[ 'pid' ] ) && $url[ 'pid' ] ? $url[ 'pid' ] : $url[ 'sid' ];
        if ( !( ( int )$sid ) ) {
            return false;
        }
//     $url[ 'Itemid' ] = 0;        
       $url[ 'Itemid' ] = $ItemID;

Some explanations: the fix does not working only in AlphaBar, but in couple of other instances where SoBiPro adds Itemid=0, but the AlphaBar is the most likely place to have this problem.

We first detected the actual ItemID with this line:

        $ItemID=JRequest::getInt('Itemid');

Then replaced the default with this value (first commenting out the old default, then adding the newly found value):

//        $url[ 'Itemid' ] = 0;        
         $url[ 'Itemid' ] = $ItemID;

So if SoBiPro detects a usable ItemID, that will work, as before. But if fails detecting one, the ItemID of the page from where the above code was called will be used instead, and not the Itemid=0 default setting, wich creates problems on most cases.

Use it on your own risk, and remember, this is qualifying as a Core Hack!!


 

Visit http://sprinklerrepairguy.com to find out more regarding Lawn Irrigation