Links on user control panel menu all wrong

  • Posts: 322
  • Thank you received: 18
  • Hikashop Business
1 week 5 days ago #364572

-- HikaShop version -- : 5.1.1
-- Joomla version -- : 5.2

1. If you create menu item for user control panel (hikashop) you get this:


All great and ok.
If you click on first item Customer Acount, you get:

All ok. But if you click on cancel, you get user profile summary and cant get back to CP. You are stuck in profile.

2. Non of the links for addresses, orders, carts and downloads have right urls. I created menu item for each and set my custom aliases.
Example:
My url/alias for cp is domain.com/uporabniska-nadzorna-plosca
My url/alias for downloads is domain.com/datoteke
When I click on Downloads in cp, I get domain.com/uporabniska-nadzorna-plosca/user/downloads. When I click back, I get domain.com/uporabniska-nadzorna-plosca/user/cpanel

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82913
  • Thank you received: 13389
  • MODERATOR
1 week 5 days ago #364577

Hi,

1. In the "HikaShop joomla user account link plugin" settings page via the Joomla plugins manager, you have a setting "Redirect back". Please make sure that this setting is activated.

2. There is indeed no mechanism to automatically search for a potential menu item for each page of the control panel to use instead of staying on the current menu item.
This would require development to support this in the cpanel function of the file components/com_hikashop/views/user/view.html.php

Please Log in or Create an account to join the conversation.

  • Posts: 322
  • Thank you received: 18
  • Hikashop Business
1 week 5 days ago #364597

1. I have allready enabled Redirect back option. I also try to enter Force menu item id. No change.
edit:
It works with save. But not working with cancel. It should go back to CP when click cancel.

2. Well, this is just esential functionality.

Last edit: 1 week 5 days ago by mojweb.

Please Log in or Create an account to join the conversation.

  • Posts: 82913
  • Thank you received: 13389
  • MODERATOR
1 week 4 days ago #364599

Hi,

1. For the cancel button, the problem is in Joomla. In the file components/com_users/src/Controller/ProfileController.php , near the end of the file, you have the "cancel" function:

public function cancel()
    {
        // Check for request forgeries.
        $this->checkToken();

        // Flush the data from the session.
        $this->app->setUserState('com_users.edit.profile', null);

        // Redirect to user profile.
        $this->setRedirect(Route::_('index.php?option=com_users&view=profile', false));
    }
This code redirects to the user profile, no matter what.
Ideally, this code should be changed to:
public function cancel()
    {
        // Check for request forgeries.
        $this->checkToken();

        // Flush the data from the session.
        $this->app->setUserState('com_users.edit.profile', null);

                $redirect = $app->getUserState('com_users.edit.profile.redirect');

                // Don't redirect to an external URL.
                if (!Uri::isInternal($redirect)) {
                    $redirect = null;
                }
                if (!$redirect) {
                    $redirect = 'index.php?option=com_users&view=profile';
                }


        // Redirect to user profile.
        $this->setRedirect(Route::_($redirect, false));
    }
The same way this is handled in the save function so that it takes into account the com_users.edit.profile.redirect state which allows 3rd party extensions to redirect back to their page.

2. While I agree that it would be a nice improvements to have, and I have noted this down on our todo list, I don't see why you think this is essential functionality. All the pages work fine without autodetecting the corresponding menu item.

Please Log in or Create an account to join the conversation.

Time to create page: 0.071 seconds
Powered by Kunena Forum