Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • peteward Friend
    #969105

    Trying to set-up a new site where some of the content is restricted to member only content.

    Each article has a Intro section with a read more break. If the article is restricted access, the "Read More" button on a Category Blog page changes to "Register to Read More" which, when clicked, takes the user to a login page, as it should.

    Using the JA Sugite (and also JA Biz) template, once logged in, the user is directed to their profile page.

    Using the Beez or Prostar templates, the user is directed back to the page.

    Looking at the pages in detail, using JA Sugite template, the "Register to Read More" link for one of the articles is

    /membersonly/index.php/login?return=L21lbWJlcnNvbmx5L2luZGV4LnBocC9hZHZpY2UvNjMtY2FtcGRlbi1icmktbmV3cy13LWMtNS1zZXA=

    but when using the Beez template the link is

    /membersonly/index.php/login?return=aW5kZXgucGhwP29wdGlvbj1jb21fY29udGVudCZ2aWV3PWFydGljbGUmaWQ9NjM6Y2FtcGRlbi1icmktbmV3cy13LWMtNS1zZXAmY2F0aWQ9OSZJdGVtaWQ9MTI2

    Once the login page is reached, on JA Sugite I see a return value

    aW5kZXgucGhwP29wdGlvbj1jb21fdXNlcnMmdmlldz1wcm9maWxl

    but with Beez the return value is

    aW5kZXgucGhwP29wdGlvbj1jb21fY29udGVudCZ2aWV3PWFydGljbGUmaWQ9NjM6Y2FtcGRlbi1icmktbmV3cy13LWMtNS1zZXAmY2F0aWQ9OSZJdGVtaWQ9MTI2

    If I use Beez as the default template but use a menu link for login to specify JA Sugite for the login page, the correct value is sent. It looks as thought Sugite is preparing an incorrect return value and/or the login page is not interpreting the return value correctly.

    I have added the site info to the Staff/Mod section. It is the advice section which has registered content.

    Saguaros Moderator
    #969420

    @peteward

    I got your point, let me investigate further on this and will get back to you.

    Ninja Lead Moderator
    #969671

    Hi,

    I fixed the problem directly on your site with the solution below

    Open templates/ja_sugite/html/com_content/category/blog_item.php file

    find

    if ($params->get('access-view')) :
        $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
    else :
        $menu      = JFactory::getApplication()->getMenu();
        $active    = $menu->getActive();
        $itemId    = $active->id;
        $link1     = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
        $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
        $link      = new JURI($link1);
        $link->setVar('return', base64_encode($returnURL));
    endif;

    to

    if ($params->get('access-view')) :
        $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
    else :
        $menu = JFactory::getApplication()->getMenu();
        $active = $menu->getActive();
        $itemId = $active->id;
        $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false));
        $link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)));
    endif;

    Now, it’s working as well on your site.

    Regards

    peteward Friend
    #969788

    Thanks for the assistance, was driving me mad!

    That solves the immediate problem on the Sugite template. The same problem still exists on JA Biz (which I do hope to use on other sites).

    Will future updates of Sugite/Biz contain the fix or will I need to always apply it every time I update the template?

    Ninja Lead Moderator
    #970070

    @peteward: You can apply the same my solution above to JA Biz template and change it from
    templates/ja_biz/html/com_content/category/blog_item.php file

    Besides that, I already raised this bug to development team here and they will update it next JA Biz and JA Sugite template

Viewing 5 posts - 1 through 5 (of 5 total)

This topic contains 4 replies, has 3 voices, and was last updated by  Ninja Lead 7 years, 8 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum