Error with my custom themes after upgrade to version 3.1.2

Hi,

Today I tried to upgrade my OJS version 3.1.1-4 for 3.1.2. Apparently, it work well, except for my custom theme. If I change for the default theme, it works, but with my theme i got this error:

[Wed May 22 17:59:17.627358 2019] [proxy_fcgi:error] [pid 11476] [client 150.164.83.181:51800] AH01071: Got error 'PHP message: PHP Warning:  Declaration of CustomBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /home/revistas2/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134\nPHP message: PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendcomponentsnavigat"  on line 30 "{php}continue;{/php}" {php}{/php} tags not allowed. Use SmartyBC to enable them <-- \n  thrown in /home/revistas2/public_html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 30\n'

This theme works perfectly in the 3.1.1-4 version.

Can someone help me with this?

Thank you!

Hi @rique,

We upgraded to a new version of the Smarty template library for OJS 3.1.2, and this changed a few aspects of the template language it supports. The relevant message in your error log is:

PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendcomponentsnavigat"  on line 30 "{php}continue;{/php}" {php}{/php} tags not allowed. Use SmartyBC to enable them <--

To fix it, replace

{php}continue;{/php}

…with…

{continue}

Likewise, replace {php}break;{/php} with {break} if you use that.

Regards,
Alec Smecher
Public Knowledge Project Team

You’re right, thank you!

Another thing, when i upgraded my database this message appeared:

WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.

WARNING: The NavigationMenu (ContextId: 7, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 7, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.

WARNING: The NavigationMenu (ContextId: 8, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 8, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.

WARNING: The NavigationMenu (ContextId: 9, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 9, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.

WARNING: The NavigationMenu (ContextId: 6, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 6, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.

WARNING: The NavigationMenu (ContextId: 3, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 3, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.

WARNING: The NavigationMenu (ContextId: 4, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 4, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.

WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.

PHP Notice:  Only variables should be assigned by reference in /home/journal/public_html/lib/pkp/classes/cliTool/UpgradeTool.inc.php on line 97

Do you know what happened here ?

Hi @rique,

I’m not sure about those warnings myself, but @Dimitris_Efstathiou probably knows!

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you again!

Hi @Dimitris_Efstathiou, can you help me with this man ?

Hi @rique,

The warnings you show are a result of the upgrade process. It actually says that the default installation of the specified navigation menus is going to be skipped, in order not to mess with your already existing NavigationMenu configuration/changes.

Do you encounter any issues regarding your installation’s Navigation Menus after the upgrade?

Regards,
@Dimitris_Efstathiou

1 Like

Hi @Dimitris_Efstathiou!

Not for now. If I notice a problem, I’ll get in touch. Thank you!

Hello Dimitris, I have a similar issue as @rique, although the upgrade process seems to have ended successfully, custom static pages linked to custom menu items are not displayed anymore.

The upgrade process shows these warnings:
…
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]

[code: Installer Installer::installDefaultNavigationMenus]
WARNING: The NavigationMenu (ContextId: 32, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 32, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attac
hed.
WARNING: The NavigationMenu (ContextId: 15, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 15, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attac
hed.
WARNING: The NavigationMenu (ContextId: 13, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 13, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attac
hed.
WARNING: The NavigationMenu (ContextId: 25, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 25, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attac
hed.

Followed by these other warnings:

WARNING: The StaticPage “Libros” uses a path (libros) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.

WARNING: The StaticPage “Equipos de Trabajo” uses a path (equipoeditorial1) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.

WARNING: The StaticPage “Indizada en” uses a path (Indices1) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
WARNING: The StaticPage “Índice H, Journal Scholar Metrics y otros datos estadísticos” uses a path (estadistica3) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
WARNING: The StaticPage “Porcentaje de Rechazo y Retiro” uses a path (rechazoyretiro1) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
WARNING: The StaticPage “Ética y Buenas Prácticas” uses a path (etica1) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
WARNING: The StaticPage “Frecuencia de publicación” uses a path (periodicidad1) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
WARNING: The StaticPage “Preservación” uses a path (preservacion1) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
WARNING: The StaticPage “Índices” uses a path (indices) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
…

At the end, the upgrade process shows the message: Successfully upgraded to version 3.1.2.0:
…
#4547: “Create Reviewer” reviewer selection option breaks email template
#4561: Fix Google Scholar plugin enabling on upgrade
#4562: Hide edit/delete/upload link actions for galleys from authors

PHP Notice: Only variables should be assigned by reference in /var/www/ojs/lib/pkp/classes/cliTool/UpgradeTool.inc.php on line 97
Successfully upgraded to version 3.1.2.0

Hi @santsho!

The warnings about the static pages are also part of the upgrade process. The navigation menu feature by default is trying to change any static page it finds in your installation into a custom navigation menu item with the same path and the same content. If it already find one custom navigation menu item with the specified path, the upgrade process skips that static page from changing into a navigation menu item.

Now, regarding your issue, could you give more info? First of all, I suppose you where using both static pages plugin and also you had added corresponding custom navigation menu items(NMIs)? If so, can you confirm that after the upgrade, the NMIs have the same path and context as before? Another thing we can check is whether those NMIs are still at the previously assigned Navigation Menus. Those information could also be found at the Navigation Menus feature management pages.

Thanks.
@Dimitris_Efstathiou

Hi Dimitris,

Yes, we are using both: static pages and custom navigation menu items. I can see MNI have the same context and path as before upgrade.

I did a test in a 3.1.2 fresh installation:

  • Created a staic page “Page1” with path “p1”
  • Created a NMI “Page One” of “Custom Page” type and path “p1”.
  • Enabled NMI “Page One” in Primary Navigation Menu

When clic “Page One” menu, static page “Page1” content is not shown

Hi @santsho.

Could you try either create a custom NMI with the path and content you need, without creating a static page with the same path? Do you have a case in hand where you need to implement such a scenario?

Thanks,
@Dimitris_Efstathiou

Hi @Dimitris_Efstathiou,

My site have many static pages. When I upgrade the system, it automatically trying to create an menu item for every static page. But, some static pages already have menu itens, then the upgrade skip this cases.

I understood correctly? Then, I should ignore it ?

And this message:

PHP Notice: Only variables should be assigned by reference in /home/magazine/public_html/lib/pkp/classes/cliTool/UpgradeTool.inc.php on line 97

What it can be ?

Hi @rique,

Yes that is the point. So you can safely ignore the warnings.

Of course, you could check whether the upgrade process correctly transferred your static pages into Navigation Menus/Navigation menu items.

Regards,
@Dimitris_Efstathiou

Thank you @Dimitris_Efstathiou!

And this message I can igone too?

PHP Notice: Only variables should be assigned by reference in /home/magazine/public_html/lib/pkp/classes/cliTool/UpgradeTool.inc.php on line 97

Hi @rique.

You can ignore it.

Regards!
@Dimitris_Efstathiou

@Dimitris_Efstathiou

Thank you!

Updated!