Upgrade OJS2 to OJS31: errors occurred in the backend

Hi,

I just installed OJS3.1 and made a complete migration from OJS2. The installation went well. No error occurred.
But I have errors occurred when I navigate on submission page or use “Navigation Menus” features in the backend.

1. Error in submission page of a journal
When I go to the menu “submission” a journal for example with this fake link:
http://portal-journals.org/ojs3/index.php/journal/submissions

A pop-up appears with the following error:
An unexpected error has occurred. Please reload the page and try again.

And I have this message in error log file:
PHP Parse error: syntax error, unexpected ‘class’ (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or ‘{’ or ‘$’ in /var/www/ojs3/lib/pkp/lib/vendor/slim/slim/Slim/Container.php on line 149, referer: http://portal-journals.org/ojs3/index.php/journal/submissions

2. Error in settings in “Navigation Menus” tab in site level
When I go to the menu “settings” in “Navigation Menus” tab on site level Administration for example with this fake link:
http://portal-journals.org/ojs3/index.php/index/admin/settings

When I want to edit or add “Navigation Menu Items”, a pop-up appears with the following error:
Failed Ajax request or invalid JSON returned

And I have this message in error log file:
PHP Fatal error: Call to a member function getPath() on a non-object in /var/www/ojs3/cache/t_compile/afdbc343a85db3051c96acebe4dc1fed0244d413^%%56^56A^56A06BB9%%navigationMenuItemsForm.tpl.php on line 62, referer: http://portal-journals.org/ojs3/index.php/index/admin/settings

And there is the code on line 62 of /var/www/ojs3/cache/t_compile/*navigationMenuItemsForm.tpl.php file
<?php echo ((is_array($_tmp=((is_array($_tmp=$this->_plugins['function']['url'][0][0]->smartyUrl(array('router' => @ROUTE_PAGE,'context' => $this->_tpl_vars['currentContext']->getPath(),'page' => 'navigationMenu','op' => 'view','path' => 'REPLACEME'), $this))) ? $this->_run_mod_handler('replace', true, $_tmp, 'REPLACEME', "%PATH%") : smarty_modifier_replace($_tmp, 'REPLACEME', "%PATH%")))) ? $this->_run_mod_handler('assign', true, $_tmp, 'exampleUrl') : $this->_plugins['modifier']['assign'][0][0]->smartyAssign($_tmp, 'exampleUrl'));?>

I didn’t have those problems when I upgraded from OJS2 to OJS3.0.2.
Are these problems due to my specific installation or are they generic problems ?

Thanks in advance for your answers.
Best regards.
Helene

Hi @hcl,

What version of PHP is your server running?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I use PHP 5.4
I was too confident. I didn’t see requirement of PHP version has changed between OJS302 and OJS31 from PHP >= 5.3.7 to PHP >= 5.6.
I will upgrade my PHP version, and I get back to you if I still have a problem.

Thanks for your answer.
Helene

Hi @asmecher,

I upgraded my PHP version to 5.6.x.

I didn’t have any more the error on: 1. Error in submission page of a journal
But I still have the same error on: 2. Error in settings in “Navigation Menus” tab in site level
I cleared the cache many times since.

Thanks in advance for your help.
Best regards.
Helene

Hi @hcl.

There is an issue filed for that.

You find the fix here NavigationMenus - Custom Page Error on Site level · Issue #3080 · pkp/pkp-lib · GitHub.
The change is included in the latest OJS version.

Thanks!