Menu items and modules lost due to redirects


  • Default avatar
    comenaranjas    
     10 months ago  last edited 10 months ago
    0

    Hi


    When pressing "Reward Payout" (request) from frontend/credit history system redirects to url ?option=com_aworewards&view=credit which looses menu items etc


    Is the same case for the login when clicking in menu item for credit or history page at frontend, you are requested to enter username and password in a link 

    ?option=com_users&view=login&return=aW5kZXgucGhwP0l0ZW1pZD0yNzI4Jm9wdGlvbj1jb21fYXdvcmV3YXJkcw%3D%3D


    The effect of this is modules and menus lost.

    I have menu links for log in etc but AwoRewards seems to create different links.


    You know a way we could avoid this?


    Regards

  • Your avatar
    seyi    
     10 months ago
    0

    Hello,

    In www/components/com_aworewards/aworewards.php, around line 37 is this:
    <?php
            $redirect_url 
    version_compareJVERSION'1.6.0''ge' 
                    'index.php?option=com_users&view=login'
                    'index.php?option=com_user&view=login'
                    ;
    ?>


    Change it to this:
    <?php
            $Itemid 
    JRequest::getVar('Itemid');
            $redirect_url version_compareJVERSION'1.6.0''ge' 
                    'index.php?option=com_users&view=login&Itemid='.$Itemid
                    
    'index.php?option=com_user&view=login&Itemid='.$Itemid
                    
    ;
    ?>



    And in www/components/com_aworewards/controller.php, around line 50 is this:
    <?php
            
    if(!empty($errors)) {
                JFactory::getApplication()->enqueueMessage($errors'error');
                $this->setRedirect('index.php?option=com_aworewards&view=credit');
            }
            else $this->setRedirect('index.php?option=com_aworewards&view=credit'JText::_'COM_AWOREWARDS_MSG_ITEM_SAVE' ));
    ?>


    Change it to this:
    <?php
            $Itemid 
    JRequest::getVar('Itemid');
            if(!empty($errors)) {
                JFactory::getApplication()->enqueueMessage($errors'error');
                $this->setRedirect('index.php?option=com_aworewards&view=credit&Itemid='.$Itemid);
            }
            else $this->setRedirect('index.php?option=com_aworewards&view=credit&Itemid='.$ItemidJText::_'COM_AWOREWARDS_MSG_ITEM_SAVE' ));
    ?>


    That should fix both

  • Default avatar
    comenaranjas    
     10 months ago
    0

    That indeed fixed both issues, many thanks