PDFs are not displayed after upgrading from 3.3.0-13 to 3.3.0-14

Describe the issue or problem
After upgrading to 3.3.0-14 the pdfs are not displayed anymore.

Steps I took leading up to the issue

  1. When I click on the PDF button of a published article, I get the error (in Chrome): “Paget does not work”. In Safari, instead of pdf, there is a white page. No pdf is displayed.

What application are you using?
I am using OJS 3.3.0-14. If I turn back to OJS 3.3.0-13 everything works perfect.

Additional information
I verified the links and they are ok.
[Error] Failed to load resource: the server responded with a status of 500 (Internal Server Error) (39, line 0)
I observed that galley file is not visible in Review stage. There is only an infinite progress circle saying “Loading”.

Please, help!
Nicolae

Probably the location of the files is set wrong, check the config.inc.php file and the files directive, it should be pointing to the physical location on the server, e.g., files_dir = /home/usersever/files
Remembering that the file directory cannot be in the root or public_html of the server

I checked, everything is ok.
Strange thing: if I open an article with Chrome, the extension EndNote Click can see the pdf and can download it!!!

After I disable the pdf.js pdf viewer plugin, a click on the pdf button can download the pdf. Could it be a problem with this plugin?

@asmecher - we had the same (PDFs not showing) on our production server after the upgrade and a few further nuisances (Administration page did not show properly).
We still run the recommended PHP 7.3 version (although not supported anymore).

The following errors were in our error logs:

AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Class 'IntlDateFormatter' not found in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/php81_bc/strftime/src/php-8.1-strftime.php:60\nStack trace:\n#0 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/php81_bc/strftime/src/php-8.1-strftime.php(201): PHP81_BC\\{closure}(Object(DateTime), '%B')\n#1 [internal function]: PHP81_BC\\{closure}(Array)\n#2 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/php81_bc/strftime/src/php-8.1-strftime.php(180): preg_replace_callback('/(?<!%)%([_#-]?...', Object(Closure), '%e %B %Y')\n#3 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.date_format.php(84): PHP81_BC\\strftime('%e %B %Y', Object(DateTime))\n#4 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/cache/t_compile/f9b5b12e442feea7b27a2eea06874fbd00cf0f55^e60dfbe008759521933fa34101e1d5648a9027f7_0.plugins-1-plugins-generic-pdfJsViewer-generic-pdfJsViewer.submissionGalley.tpl.php(39): smarty_modif...', referer: https://chimia.ch/chimia/article/view/2019_724

AH01071: Got error 'PHP message: PHP Warning:  ini_set(): A session is active. You cannot change the session module's ini settings at this time in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/classes/session/SessionManager.inc.php on line 71PHP message: PHP Fatal error:  Uncaught Error: Class 'IntlDateFormatter' not found in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/php81_bc/strftime/src/php-8.1-strftime.php:60\nStack trace:\n#0 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/php81_bc/strftime/src/php-8.1-strftime.php(201): PHP81_BC\\{closure}(Object(DateTime), '%B')\n#1 [internal function]: PHP81_BC\\{closure}(Array)\n#2 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/php81_bc/strftime/src/php-8.1-strftime.php(180): preg_replace_callback('/(?<!%)%([_#-]?...', Object(Closure), '%B %e, %Y - %I:...')\n#3 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.date_format.php(84): PHP81_BC\\strftime('%B %e, %Y - %I:...', Object(DateTime))\n#4 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/cache/t_compile/58602cf8e0d794be60307948e3b75c8078ff3454^ec004744317f29c2a6de74168cf42e47da599ebd_0.app.adminsystemInfo.tpl.php(64): smarty_modifier_date_format('2023-02-27 15:0......', referer: https://www.chimia.ch/index/admin

I tried to install the PHP intl extension as recommended here in the forum, but was not fortunate … Therefore, I did a rollback (db backup and code).

Funnily, on our test server running PHP 7.3 everything went smooth with the upgrade.

Can we safely go to PHP 8.1 with OJS 3.3.0-14 ? Then I would instruct our system admin to install it then and test again on our test server.

Maybe the difference between Test (where OJS 3.3.0-14 runs fine) and Prod (where it fails) is because of the PHP versions:

Test:

PHP 7.3.33-10+0~20230214.103+debian10~1.gbp88ff76 (cli) (built: Feb 14 2023 18:27:32) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.33-10+0~20230214.103+debian10~1.gbp88ff76, Copyright (c) 1999-2018, by Zend Technologies

Production:

PHP 7.3.33-9+0~20230106.102+debian10~1.gbpc4e85f (cli) (built: Jan  6 2023 18:38:20) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.33-9+0~20230106.102+debian10~1.gbpc4e85f, Copyright (c) 1999-2018, by Zend Technologies

Hi @mpbraendle,

OJS 3.3.0-14 should work fine with PHP8.1, with the intl extension installed. I’d suggest double-checking your phpinfo output to confirm that the module was successfully enabled. If it is, you should see something like this:


(Make sure you check via the browser, otherwise you might be testing the wrong PHP configuration e.g. via the command line.)

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Thank you, we’ll try.

@asmecher No, it doesn’t.
I have now
PHP Version 8.1.16
intl Version 65.1
enabled, but the test installation yields a white page when I access a article details page.
Here the two PHP Fatal errors that occur:

AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string in /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/i18n/LocaleFile.inc.php:102\nStack trace:\n#0 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/i18n/LocaleFile.inc.php(102): str_replace()\n#1 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/i18n/PKPLocale.inc.php(266): LocaleFile->translate()\n#2 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/i18n/PKPLocale.inc.php(914): PKPLocale::translate()\n#3 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/plugins/generic/dublinCoreMeta/DublinCoreMetaPlugin.inc.php(116): __()\n#4 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/plugins/HookRegistry.inc.php(107): DublinCoreMetaPlugin->articleView()\n#5 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/pages/article/ArticleHandler.inc.php(319): HookRegistry::call()\n#6 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/l...', referer: https://devojs.chimia.ch/chimia/index
AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, array given in /var/www/virtual/devojs.chimia.ch/htdocs/ojs/plugins/generic/googleScholar/GoogleScholarPlugin.inc.php:99\nStack trace:\n#0 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/plugins/generic/googleScholar/GoogleScholarPlugin.inc.php(99): htmlspecialchars()\n#1 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/plugins/HookRegistry.inc.php(107): GoogleScholarPlugin->submissionView()\n#2 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/pages/article/ArticleHandler.inc.php(319): HookRegistry::call()\n#3 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/core/PKPRouter.inc.php(395): ArticleHandler->view()\n#4 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest()\n#5 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route()\n#6 /...', referer: https://devojs.chimia.ch/chimia/

Offending line in LocaleFile.inc

Offending line in GoogleScholarPlugin.inc.php

OJS 3.3.0-14, Google Scholar plugin is up-to-date as well

This topic was automatically closed after 13 days. New replies are no longer allowed.