In navigation unable to save remote link

I am trying to create a link by using the navigation, Remote URL, but I am unable to save it.

In Navigation Menu Items, Add item then add remote URL, but Unable to save it. How to fix this issue???

I am using OJS 3.3.0.10

Hi @umer,

Do you have access to your PHP error logs and can provide any error messages from there? That may provide more insight into the issue you are experiencing.

Best regards,

Roger
PKP Team

Hi @rcgillis I have a similar issue with remote url link creation under index journal page

log:

Error: Call to a member function getPrimaryLocale() on null in /var/www/ojs/lib/pkp/controllers/grid/navigationMenus/form/PKPNavigationMenuItemsForm.inc.php:227\nStack trace:\n#0 /var/www/ojs/lib/pkp/controllers/grid/navigationMenus/NavigationMenuItemsGridHandler.inc.php(164): PKPNavigationMenuItemsForm->validate()\n#1 /var/www/ojs/lib/pkp/classes/core/PKPRouter.inc.php(395): NavigationMenuItemsGridHandler->updateNavigationMenuItem()\n#2 /var/www/ojs/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest()\n#3 /var/www/ojs/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route()\n#4 /var/www/ojs/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch()\n#5 /var/www/ojs/index.php(68): PKPApplication->execute()\n#6 {main}\n thrown in /var/www/ojs/lib/pkp/controllers/grid/navigationMenus/form/PKPNavigationMenuItemsForm.inc.php on line 227

Hi @umer and @rcgillis,
I’m getting the same problem as well. I’m currently using OJS 3.3.0.10 just same yours as shown in the pic below:

Error language

Log file Erorrs are

[29-Jun-2022 12:24:13 Asia/Baghdad] PHP Fatal error: Uncaught Error: Call to a member function getPrimaryLocale() on null in /home2//public_html/lib/pkp/controllers/grid/navigationMenus/form/PKPNavigationMenuItemsForm.inc.php:227
Stack trace:
#0 /home2/
/public_html/lib/pkp/controllers/grid/navigationMenus/NavigationMenuItemsGridHandler.inc.php(164): PKPNavigationMenuItemsForm->validate()
#1 /home2//public_html/lib/pkp/classes/core/PKPRouter.inc.php(395): NavigationMenuItemsGridHandler->updateNavigationMenuItem(Array, Object(Request))
#2 /home2/
/public_html/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)
#3 /home2/journaluokufaedu/public_html/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route(Object(Request))
#4 /home2//public_html/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#5 /home2/
/public_html/index.php(68): PKPApplica in /home2/**********/public_html/lib/pkp/controllers/grid/navigationMenus/form/PKPNavigationMenuItemsForm.inc.php on line 227

Any help to fix this fatal error will be really appreciated

Hi everyone, It also happens on OJS 3.3.0.11
php error log:

[01-Jul-2022 01:54:33 Asia/Jakarta] PHP Fatal error:  Uncaught Error: Call to a member function getPrimaryLocale() on null in /Applications/MAMP/htdocs/pasca33011/lib/pkp/controllers/grid/navigationMenus/form/PKPNavigationMenuItemsForm.inc.php:227
Stack trace:
#0 /Applications/MAMP/htdocs/pasca33011/lib/pkp/controllers/grid/navigationMenus/NavigationMenuItemsGridHandler.inc.php(164): PKPNavigationMenuItemsForm->validate()
#1 /Applications/MAMP/htdocs/pasca33011/lib/pkp/classes/core/PKPRouter.inc.php(395): NavigationMenuItemsGridHandler->updateNavigationMenuItem(Array, Object(Request))
#2 /Applications/MAMP/htdocs/pasca33011/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)
#3 /Applications/MAMP/htdocs/pasca33011/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route(Object(Request))
#4 /Applications/MAMP/htdocs/pasca33011/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#5 /Applications/MAMP/htdocs/pasca33011/index.php(68): PKP in /Applications/MAMP/htdocs/pasca33011/lib/pkp/controllers/grid/navigationMenus/form/PKPNavigationMenuItemsForm.inc.php on line 227

Chrome->XHR/Fetch
Screen Shot 2022-07-01 at 01.51.41

I hope @asmecher can help us about this issue.

Having the same issue here:

image

Here is the log information:

[php7:error] [pid 1646] [client 10.20.1.33:41248] PHP Fatal error:  Uncaught Error: Call to a member function getPrimaryLocale() on null in /var/www/ojs/lib/pkp/controllers/grid/navigationMenus/form/PKPNavigationMenuItemsForm.inc.php:227\nStack trace:\n#0 /var/www/ojs/lib/pkp/controllers/grid/navigationMenus/NavigationMenuItemsGridHandler.inc.php(164): PKPNavigationMenuItemsForm->validate()\n#1 /var/www/ojs/lib/pkp/classes/core/PKPRouter.inc.php(395): NavigationMenuItemsGridHandler->updateNavigationMenuItem()\n#2 /var/www/ojs/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest()\n#3 /var/www/ojs/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route()\n#4 /var/www/ojs/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch()\n#5 /var/www/ojs/index.php(68): PKPApplication->execute()\n#6 {main}\n  thrown in /var/www/ojs/lib/pkp/controllers/grid/navigationMenus/form/PKPNavigationMenuItemsForm.inc.php on line 227, referer: https://journals.reduc.edu.cu/index.php/index/admin/settings

Hi everyone, I found a temporal solution and it works on my case. Now i can save navigation menu item with Remote URL.

On my ojs root folder, I go to

lib/pkp/controllers/grid/navigationMenus/form/PKPNavigationMenuItemsForm.inc.php

and comment out on line 227 as image follows:
image

Hope it helps.

2 Likes

Thanks a lot.
This also worked for me.

@dnaite Thanks a lot! This is worked for me as well
Cheers,

@asmecher Is there any explanation about this problem please?

Hey @Salam_Al-Khammasi,

I’m not sure why this is happening, but the journal context is coming up null here:

So trying to get the primary locale in line 227 that you’ve commented out causes a fatal error.

Are you running into these errors anywhere else in the application?

Another question: are you running a multi-journal installation?

Thanks.

Regards,

Erik
PKP Team

Hey @ewhanson ,
Thank you so much for your quick response. Tbh I’m not sure either.
To answer your questions:

  • The translation for the menus are working perfectly for the other journals. I’m not running these errors anywhere in the application. I only got this error when I translate a remote URL in the Primary Navigation Menu in the Main website as shown in the screen shoot

image

  • Yes, I’m running more than 15 journal in the same OJS installation

Helping us with this issue is really highly appreciated.
Thanks in advance.
-Salam

Hey @Salam_Al-Khammasi,

Thanks for sharing the details. I think I know what might be going on here? Could you share the full url of the page where you’re encountering this error (you can remove your domain name, I’m just curious to se the index.php/[...] part).

I suspect that if you’re accusing this from the admin context (with an https://[...]/index.php/admin/... URL), which internally means there is no context, you’ll run into this error. If you go to edit the navigation menu from the journal context (with an https://[...]/index.php/[journal_abbreviation_here]/...).

Let me know if you have any luck with this!

Regards,

Erik
PKP Team

Hey @ewhanson,
I’m really sorry for the late response. the full url of the page that I encountering that error is below

https://-----------/index.php/index/admin/settings#setup/nav

I can’t go to edit the navigation from the journal context because I only display a set of journals on that page. As I mentioned earlier, I work fine for the other journals since they have journal context.

Regards,
-Salam

A customer reported the same problem: it is possible to create item of type “remote URL” only in the context of a journal, and not in the main site.