0
votes

I am working on a client's website which is based on the Joomla 2.5 framework. With SEF turned off (the in built Joomla version) the URL is this

http://(domain)/index.php?option=com_cmgroupbuying&view=alldeals&Itemid=424

The user has a plugin, I have built into a plugin the line to make sure this plugin only fires when the component CMGroupbuying is in use

$component = JRequest::getCmd('option'); 
if($component =='com_cmgroupbuying')
               { etc etc }

With SEF turned off, this works beautifully. However when I enable SEF the URL turns into

http://(domain)/the-deals

and the detection script stops working as joomla just no longer sees the Request::getCmd('option'); being equal to com_cmgroupbuying which to be honest, blows me away as it renders getCmd totally useless. I have seen other prople suffer with this in the part but not found any definitive fix

Can anyone offer a solution to stop this failure of Joomla, either by some extra lines in the DEFAULT htaccess fault to retain this information for joomla to use, or maybe detecting part of the URL so I can build a detector script from that

1
Did you tried with JRequest::getVar('option'); ? - Jobin

1 Answers

0
votes

Fixed thanks to a user on the joomla stack exchange

The function was wrapped in a

class plgSystemCMMobileDetection extends JPlugin {
    public function onAfterInitialise()
    {

which means the function was firing before the routing is done. I just changed onAfterInitialise to onAfterRoute and all was fixed!