Topic-icon PostgreSql installation problems

Active Subscriptions:

None
10 years 5 months ago #39796 by everburninglight
The only thing that I modified is line 22 in mod_sclogin.php:

//$jLogoutUrl = $helper->getLoginRedirect('jlogout');

I have to say that, without the comment, also the other component Responsivizer went into eternal loop on mobile devices and was giving an error page. If I remember, it said something like too many recurring links.

There must be something in that function that is causing problems. But I don't explain how the new installation of JFBConnect could change mod_sclogin.

I see that there is an updated version of SClogin now. I didn't try that, but from the changes I can see, they should have no impact.
The topic has been locked.
Support Specialist
10 years 4 months ago #39821 by alzander
Ahhh.. thanks for pointing that out. The logout logic looks to see if you're trying to let the user logout to a 'Registered' page and, if so, will redirect them to the home page instead of back to the Login module.

The error occurs if you're on a page that doesn't have an Itemid. If you want to fix that issue the correct way, you can edit the helper.php file. Around line 121, you'll see:
if ($itemId == "")
                $itemId = JFactory::getApplication()->input->getInt('Itemid', '');
            $db = JFactory::getDBO();
            $query = "SELECT * FROM #__menu WHERE id=" . $db->quote($itemId);
            $db->setQuery($query);
            $menuItem = $db->loadObject();
            if ($menuItem && $menuItem->access != "1")
            {
                $default = JFactory::getApplication()->getMenu()->getDefault();
                $url = JRoute::_($default->link . '&Itemid=' . $default->id, false);
            }
Update that with an extra check before the query, like:
if ($itemId == "")
                $itemId = JFactory::getApplication()->input->getInt('Itemid', '');
            if ($itemId != "")
            {
               $db = JFactory::getDBO();
               $query = "SELECT * FROM #__menu WHERE id=" . $db->quote($itemId);
               $db->setQuery($query);
               $menuItem = $db->loadObject();
               if ($menuItem && $menuItem->access != "1")
               {
                   $default = JFactory::getApplication()->getMenu()->getDefault();
                   $url = JRoute::_($default->link . '&Itemid=' . $default->id, false);
               }
            }
Thanks for pointing that out. Another area where MySQL is a bit more lenient... for better or worse :D
Alex
The topic has been locked.