I am running OJS 3.1.0.0 (code cloned from the github repository) and trying to import articles using the native ImportExport plugin (the QuickSubmit plugin does not have 3.1.0.0 in its compatibility list).
When I try to import XML, the ImportExport plugin crashes with a PHP fatal error (the stack trace is below). It crashed while importing the authors when it tried to get a production_id for the submission. Looking in the database the production_id is NULL for the submission, and the ‘publications’ table is empty. That’s because nothing has been published yet. There is one unpublished issue.
It seems odd to me that the code is trying to get a publication_id when importing fresh data which presumably would not yet have been published.
Same fatal occurs whether I use my own XML or the sample.xml (which is out of date for the xsd, but I updated the familyname/givenname tags).
Does anyone have working XML and if so which OJS version are you using and could you please send your XML?
Here is the sample.xml I used and the stack trace is below that:
<?xml version="1.0" encoding="UTF-8"?>
1
articlePublicId
urn:nbn:de:0000-tj1.v1i1.14
10.9876/tj1.v1i1.1
Article Title
The
Subtitle
the abstract
http://licenseUrl
copyright holder
2014
kw1
kw2
kw3
discipline1
discipline2
subject1
subject2
subject3
John
Smith
john.smith@your-domain.com
book reviews
.. base64 encoded data is here ...
name of the HTML file
image name
supp file
.. base64 encoded data is here ...
HTML
0
Remote galley or supp file
1
Supp File
2
14
1
2020
1 - 30
cover_article_3_en_US.png
article cover EN
.. base64 encoded data is here ...
[Fri Feb 07 12:56:46.433580 2020] [php7:notice] [pid 1085] [client 192.168.32.1:56422] PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeXmlPKPAuthorFilter.inc.php:72\nStack trace:\n#0 /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeImportFilter.inc.php(60): NativeXmlPKPAuthorFilter->handleElement(Object(DOMElement))\n#1 /var/www/html/lib/pkp/classes/filter/Filter.inc.php(449): NativeImportFilter->process(Object(DOMDocument))\n#2 /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFilter.inc.php(225): Filter->execute(Object(DOMDocument))\n#3 /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFilter.inc.php(207): NativeXmlSubmissionFilter->parseAuthor(Object(DOMElement), Object(Submission))\n#4 /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFilter.inc.php(152): NativeXmlSubmissionFilter->parseAuthors(Object(DOMElement), Object(Submission))\n#5 /var/www/html/plugins/importexport/native/filter/NativeXmlArticleFilter.inc.php(142): NativeXmlS in /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeXmlPKPAuthorFilter.inc.php on line 72, referer: https://ojs/index.php/ecms/management/importexport/plugin/NativeImportExportPlugin
when it tried to get a production_id for the submission
That’s a typo, correct? You mention publication_id elsewhere.
The publications table (and publication_id) are concepts only introduced in the master branch for release with OJS 3.2 late this month, so if you’re seeing that in your installation, I think you must be using pre-release code. Are you sure you’re working with OJS 3.1.0-0?
Regards,
Alec Smecher
Public Knowledge Project Team
After checking the code, I found I was (as you suggest) running master (commit #15b4db). We did some evaluation work in 2018 and have just come back to it. My installation got in a mess.
I have import native XML working now, after a fresh install from github stable_3_1_2 branch. I am trying to migrate our journal (ecancermedicalscience) onto OJS.
I was unable to install from an OJS3 tarball because they did not contain a package.json in the webroot directory and I could not see how to generate one. I tried one from Sept 2019 from github but then “npm run build” gave an error.
I am not sure what the best set up is for the least difficult upgrade path. Do you have any advice, given the upcoming release?
Thanks for your response. I have XML importing now - see my reply to Alec Smecher. Answers below for completeness.
why are you using so old OJS and not the latest? We did evaluation work in 2018 and are just coming back to the project. I have stable_3_1_2 working now.
why are you using github repo instead of a release package I am unable to install from tarball due to a missing package.json in the webroot.
have you created a journal to import to yes
how did you get the XML you want to import I had two sources: The sample.xml found in the native XML plugin directory. A generated xml file created using my own code.
I am trying to migrate our journal in its entirety to OJS3.
If you’re happy to run from stable-3_1_2 then that should be equivalent to working with the .tar.gz file, plus you get regular updates for minor issues. That’s a totally fine way to continue. Just make sure you stay on stable-3_1_2for all repositories including the submodules.
There’s no need to build the Javascript when working with the .tar.gz file; it comes prebuilt.
What kind of upgrade are you interested in doing?
Regards,
Alec Smecher
Public Knowledge Project Team
Doh - I should have realised those tarballs came pre-built. I just tried swapping one in (ojs-3.1.2-4), setting permissions, and it ran just fine with the same db and config. Docker is so handy for that sort of thing.
Re: the update path - I have just read docs/UPGRADE.md, which was helpful. I am trying to figure out the easiest upgrade path for our setup. I am not sure what that will end up being, but I see the git method is recommended.
We are only using OJS3 - its the upgrades upwards from 3.1.2 which I was trying to anticipate in my setup.
I am migrating our back catalogue and submissions from our in-house legacy bespoke PHP systems into OJS3. I am currently using the importExport plugin with native XML format. I may have to develop code for some of the nuances of submissions.