Vitaliy-1 / JATSParserPlugin

OJS3 Plugin for parsing JATS XML and displaying it on article detail page
GNU General Public License v3.0
27 stars 24 forks source link

Error with OJS 3.2.1-4 #57

Closed LoicE5 closed 3 years ago

LoicE5 commented 3 years ago

Hi Vitaliy,

My name is Loïc and I currently work as an intern in Opscidia, with Mr Charles Letaillieur, whom you have met at Barcelona in November of 2019.

I am contacting you today because my work involves the implementation of two of your OJS plugins (docxConverter and JATSParser) on an OJS system.

I am getting a fatal error and, after days of researches on the internet, I did not find any fix.

The aim of the workflow that I’m working on is to convert a docx document into a JATS document, then convert that JATS document into two galleys : HTML & PDF.

I am currently running OJS 3.2.1-4.

Steps to reproduce the error :

Go to Settings > Website > Plugins and make sure that JATSParser, DocxConverter & Texture Editor are enabled, and Lens galley is disabled. Head to Submissions (make one if the queue is empty) Click on « view submission » Error 500

The error log :

[Mon Apr 19 11:28:52.554694 2021] [php7:notice] [pid 2524] [client 192.168.1.25:55088] PHP Notice: Constant CREATE_PDF_QUERY already defined in /var/www/html/ojs2/plugins/themes/opscidia-custom-theme/OpscidiaCustomThemePlugin.inc.php on line 22, referer: http://192.168.1.11/ojs2/index.php/myjournal/submissions [Mon Apr 19 11:28:52.563770 2021] [php7:notice] [pid 2521] [client 192.168.1.25:55096] PHP Notice: Constant CREATE_PDF_QUERY already defined in /var/www/html/ojs2/plugins/themes/opscidia-custom-theme/OpscidiaCustomThemePlugin.inc.php on line 22, referer: http://192.168.1.11/ojs2/index.php/myjournal/submissions [Mon Apr 19 11:28:52.572981 2021] [php7:notice] [pid 2528] [client 192.168.1.25:55097] PHP Notice: Constant CREATE_PDF_QUERY already defined in /var/www/html/ojs2/plugins/themes/opscidia-custom-theme/OpscidiaCustomThemePlugin.inc.php on line 22, referer: http://192.168.1.11/ojs2/index.php/myjournal/submissions [Mon Apr 19 11:28:52.608663 2021] [php7:notice] [pid 2515] [client 192.168.1.25:55098] PHP Notice: Constant CREATE_PDF_QUERY already defined in /var/www/html/ojs2/plugins/themes/opscidia-custom-theme/OpscidiaCustomThemePlugin.inc.php on line 22, referer: http://192.168.1.11/ojs2/index.php/myjournal/submissions [Mon Apr 19 11:28:52.757179 2021] [php7:notice] [pid 2521] [client 192.168.1.25:55096] PHP Notice: Constant CREATE_PDF_QUERY already defined in /var/www/html/ojs2/plugins/themes/opscidia-custom-theme/OpscidiaCustomThemePlugin.inc.php on line 22, referer: http://192.168.1.11/ojs2/index.php/myjournal/submissions [Mon Apr 19 11:28:52.911368 2021] [php7:notice] [pid 2521] [client 192.168.1.25:55096] PHP Notice: Constant CREATE_PDF_QUERY already defined in /var/www/html/ojs2/plugins/themes/opscidia-custom-theme/OpscidiaCustomThemePlugin.inc.php on line 22, referer: http://192.168.1.11/ojs2/index.php/myjournal/submissions [Mon Apr 19 11:28:57.859221 2021] [php7:notice] [pid 2515] [client 192.168.1.25:55098] PHP Notice: Constant CREATE_PDF_QUERY already defined in /var/www/html/ojs2/plugins/themes/opscidia-custom-theme/OpscidiaCustomThemePlugin.inc.php on line 22, referer: http://192.168.1.11/ojs2/index.php/myjournal/submissions [Mon Apr 19 11:28:57.938505 2021] [php7:notice] [pid 2515] [client 192.168.1.25:55098] PHP Notice: Constant CREATE_PDF_QUERY already defined in /var/www/html/ojs2/plugins/themes/opscidia-custom-theme/OpscidiaCustomThemePlugin.inc.php on line 22, referer: http://192.168.1.11/ojs2/index.php/myjournal/submissions [Mon Apr 19 11:28:58.053598 2021] [php7:warn] [pid 2515] [client 192.168.1.25:55098] PHP Warning: array_unique() expects parameter 1 to be array, null given in /var/www/html/ojs2/plugins/generic/jatsParser/JatsParserPlugin.inc.php on line 1001, referer: http://192.168.1.11/ojs2/index.php/myjournal/submissions [Mon Apr 19 11:28:58.075433 2021] [php7:error] [pid 2515] [client 192.168.1.25:55098] PHP Fatal error: Uncaught Pimple\\Exception\\UnknownIdentifierException: Identifier "submissionFile" is not defined. in /var/www/html/ojs2/lib/pkp/lib/vendor/pimple/pimple/src/Pimple/Container.php:101\nStack trace:\n#0 /var/www/html/ojs2/lib/pkp/classes/core/PKPServices.inc.php(69): Pimple\\Container->offsetGet()
#1 /var/www/html/ojs2/lib/pkp/classes/core/PKPServices.inc.php(50): PKPServices->_getFromContainer()
#2 /var/www/html/ojs2/plugins/generic/jatsParser/JatsParserPlugin.inc.php(341): PKPServices::get()
#3 /var/www/html/ojs2/lib/pkp/classes/plugins/HookRegistry.inc.php(107): JatsParserPlugin->publicationTemplateData()
#4 /var/www/html/ojs2/lib/pkp/classes/template/PKPTemplateManager.inc.php(1256): HookRegistry::call()
#5 /var/www/html/ojs2/cache/t_compile/ee131ee78aae66ec621d8f4e466e22416bf8d89c^5b2b400be3d78bc0ae391c12ce66fa93bd43d118_0.app.workflowworkflow.tpl.php(262): PKPTemplateManager->smartyCallHook()
#6 /var/www/html/ojs2/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content in /var/www/html/ojs2/lib/pkp/lib/vendor/pimple/pimple/src/Pimple/Container.php on line 101, referer: http://192.168.1.11/ojs2/index.php/myjournal/submissions

Things I’ve done :

I am sending you a video with this issue, of the error that I’m getting ! It shows precisely the error 500 and where it occurs.

Link → https://drive.google.com/file/d/10SPBEX8U_jG_MNma9KIHJT_CbRVMntkZ/view?usp=sharing

Do you have any ideas about this error ?

Any help would be greatly appreciated !

Thanks by advance :)

Loïc

Vitaliy-1 commented 3 years ago

Hi @LoicE5 and nice to meet you)

The error from JATS Parser plugins most probably means that it's version isn't compatible with OJS 3.2.1. The way how the plugin works changed considerably in several latest versions. I guess you can try stable 3.2.1 branch: https://github.com/Vitaliy-1/JATSParserPlugin/tree/stable-3_2_1. Let me know if there would be any problems.

In the video create galley option originates not from the JATS Parser plugin, probably Texture but not sure. JATS Parser plugin works in a different way, new options are available under Publication tab: https://github.com/Vitaliy-1/JATSParserPlugin/blob/main/images/jatsParser_scr_1.png

The aim of the workflow that I’m working on is to convert a docx document into a JATS document, then convert that JATS document into two galleys : HTML & PDF

DOCXConverter plugin is more or less production-ready. JATS Parser has an issue left related to the linking of references, I'm expecting to fix this alongside with OJS 3.4 release. Although I use both plugins in the production in our university journal. One important thing is that JATS Parser Plugin handles JATS XML as a full-text as a property of the publication and displays it on the article landing page. It doesn't save full-text as HTML galley, e.g.: https://e-medjournal.com/index.php/psp/article/view/230. This option is available only for PDF.

LoicE5 commented 3 years ago

Hi Vitaliy,

First, thanks a lot for your quick and complete answer. This is a real pleasure to have a such great support for an open-source application :)

As you mentionned in your message, I downloaded JATSParser from the 3.2.1 branch. Or, should I say, I downloaded 3 zip files :

The 2.1.0.0 release & the direct code download (the two first points above) throws an ERROR 500 on the entire server.

The 2.0.1.1 version did not make my server crash, but no tab appeared under the "production" section, unlike your screenshot.

The issue appears to be the inner JATSParser directory to be empty.

I made a video about the issue. You can find it here → https://drive.google.com/file/d/1ay5qaDohiJTsTpTDU3t-i-9LXDcm10pJ/view?usp=sharing

Thanks a lot for your work and your support, and thanks by advance for your answer :)

Loïc

Vitaliy-1 commented 3 years ago

2.1.0.0 release is compatible only with OJS 3.2.0. Newer versions are labelled as pre-released and they work much different from the 2.1.0.0.

There are 2 ways to install it for OJS 3.2.1.

JATSParser directory is empty because it's not enough to download the source code. The plugin has a submodule with dependencies, which can be installed via Git and Composer or downloaded with the release package.

LoicE5 commented 3 years ago

Hi Vitalyi,

Thanks a lot for your really healpful answer ! It's working perfect now !

I'm just going to indicate two more steps that might help you improve the plugin or help anyone else installing it :)

  1. It might be necessary to clear the JatsParser entries in the MySQL database prior any new installation. To do so, install phpMyAdmin in the root of the html folder. Then, log in with MySQL credentials, and navigate to the ojs database. Search in all the tables (using the search tool) for "jatsparser". Write down every table that involves a such entry (usually plugin_settings& versions). Then, remove the entry. This step will help to prevent the error "Impossible to downgrade".

  2. For the composer install (to enable PDF conversion), in order to fetch JATSParser dependencies, an error occured in my case. [Composer\Json\JsonValidationException] "./composer.json" does not match the expected JSON schema: -name : Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$ To fix it, simply go to composer.json and edit it using sudo nano composer.json. Then, remove the "name" field (which has the "doc/jatsParser" value).

Hope my experience will help :)

Thanks a lot one more time for your help ! Have a nice day