When a press dashbord option on logged user nothing happen

on ojs 3.5 system

https://mydomain/index.php/index/en/index

when logon with a user and chose a Dashboard option nathing happen.

Source code page

Hi @alerbra,

If nothing is happening as a result of an action that you take within OJS, your best option is to check your PHP error logs and report on errors found there.

-Roger

PKP Team

Hi Roger,

The php log has no error.

Here are two pictures of what’s happening. Is the code for PKPNavigationMenuService.php on line 302 correct? You can see that the URL being called is the same as before. The routering has no efect this is why the question about line 302 in the code.

Correction: The code lines bellow 302.

Commenting out the 5 lines below 304 may be a solution?

The issue we are experiencing is that the user Dashboard menu option doesn’t go anywhere when loging in from the OJS portal page.

After accessing the administration page in the menu, the dashboard and journal selection menu is available.

Commenting the 5 lines below line 304 made the menu work, displaying the user main page.

Should the user be able to see it’s own user management pages from the portal context or not? Since the user is an admin, what content should be displayed? Maybe a general overview of all journals is my best suggestion at the moment. As a temporary solution, showing user profile page is better than a menu option that doesn’t do anything. Or the link should not be available in this context.

Our concern is what is the impact of removing this from file PKPNavigationMenuService.php

if ($pkpPageRouter instanceof PageRouter) {
$navigationMenuItem->setUrl($pkpPageRouter->getHomeUrl($request));
}
} else {

Does this affect other roles, or just the routing? Our tests show that it doesn’t, up until now.

Either the user menu should not show the Dashboard option when login as admin or it should display a special dashboard for the admin. What is the behavior when only one journal is hosted? Is it different? We use OJS and test it with our current data, not really as a single install so we don’t know if there’s any difference. We believe there shouldn’t be any.

File PKPNavigationMenuService.php

case NavigationMenuItem::NMI_TYPE_USER_DASHBOARD:if ($currentUser->hasRole([Role::ROLE_ID_MANAGER, Role::ROLE_ID_ASSISTANT, Role::ROLE_ID_REVIEWER, Role::ROLE_ID_AUTHOR], $contextId) || $currentUser->hasRole([Role::ROLE_ID_SITE_ADMIN], PKPApplication::SITE_CONTEXT_ID)) {$pkpPageRouter = $request->getRouter();  
/** @var \PKP\core\PKPPageRouter $pkpPageRouter */
                if ($pkpPageRouter instanceof PageRouter) {
                        $navigationMenuItem->setUrl($pkpPageRouter->getHomeUrl($request));
                    }
                } else {
                    $navigationMenuItem->setUrl($dispatcher->url(
                        $request,
                        PKPApplication::ROUTE_PAGE,
                        null,
                        'user',
                        'profile',
                        null
                    ));
                }

Hi Roger, the php error log not show a error, the problem is related with the code mentioned at PKPNavigationMenuService.php lines bellow 304.

Can you verify what happens?

Thank you.

if ($currentUser->hasRole([Role::ROLE_ID_MANAGER, Role::ROLE_ID_ASSISTANT, Role::ROLE_ID_REVIEWER, Role::ROLE_ID_AUTHOR], $contextId) || $currentUser->hasRole([Role::ROLE_ID_SITE_ADMIN], PKPApplication::SITE_CONTEXT_ID)) {
$pkpPageRouter = $request->getRouter(); /** @var \PKP\core\PKPPageRouter $pkpPageRouter */

                  if ($pkpPageRouter instanceof PageRouter) {
                        $navigationMenuItem->setUrl($pkpPageRouter->getHomeUrl($request));
                    }

Hi @alerbra,

Thank you for the update. This is outside of my area of expertise, so I have flagged this for our team members to have a look at when they are available. Hopefully you’ll hear from someone soon.

-Roger

PKP Team

@alerbra Thanks for reporting this!

Update: I was able to reproduce the issue you described.

In a multi-journal installation, when a user has the Role::ROLE_ID_SITE_ADMIN role, the system redirects them to whatever getHomeUrl returns. When the user is in the “Site context”, getHomeUrl points to the site’s home page (the list of all journals). That’s why it may look like “nothing is happening” when you click on Dashboard - but this is the intended behavior.

Here’s an example: if someone adds a Custom Page menu item in the site-level navigation menu, the Dashboard link serves as a way back to the site home page (the page listing all journals).

You correctly identified the code that handles this, but removing it may cause problems (especially during upgrades). I’d recommend restoring the code as it was.

If the current behavior doesn’t match what you want, you can always adjust the site-level main navigation menu - either removing unwanted items or adding new ones - to customize the functionality and user experience.