Overriding Return-URL in own Components doesn't work correct

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
Qlimax90
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jul 28, 2014 6:58 am

Overriding Return-URL in own Components doesn't work correct

Post by Qlimax90 » Mon Jul 28, 2014 7:25 am

Hi everyone,

if i want to overwrite the default login url which i have set in the backend, it still returns to the url from the backend.

I followed the instructions from this tutorial:
http://docs.joomla.org/How_do_you_redir ... Overriding


My redirection code:

Code: Select all

$this->app = JFactory::getApplication();
$this->user = JFactory::getUser();
if ($this->user->get('guest') == 1)
{   // Redirect to login
    $this->app->enqueueMessage(JText::_('COM_MYCOMPONENT_USER_LOGIN_FIRST'), 'notice');
    $redirectUrl = '&return=' . urlencode(base64_encode("index.php?option=com_mycomponent&view=cart"));
    $this->app->redirect(JRoute::_('index.php?option=com_users&view=login' . $redirectUrl));
    return;
}
But in the default login template the following code overwrites the return url
Path /components/com_users/views/login/tmpl/default_login.php
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url', $this->form->getValue('return'))); ?>" />
In my opinion this doesn't make sense or am wrong?


Kind regards,
Qlimax

Qlimax90
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jul 28, 2014 6:58 am

Re: Overriding Return-URL in own Components doesn't work cor

Post by Qlimax90 » Tue Aug 12, 2014 6:20 am



Locked

Return to “Joomla! 3.x Bug Reporting”