Hi everyone,
while getting some practice for an upcoming journal migration, I toyed around with the native XML import/export plugin in OJS 3.3.0-4 and ran into the following error.
As an excercise I wanted to move an issue from JournalA to JournalB on the same OJS instance. So I successfully exported a random issue of JournalA and then I tried to import the resulting XML into JournalB:
php ./tools/importExport.php NativeImportExportPlugin import ~/journala-issue-17.xml journalb UsernameOfSiteAdmin
PHP Notice: Only variables should be passed by reference in /var/www/html/plugins/importexport/native/filter/NativeXmlIssueGalleyFilter.inc.php on line 103
PHP Fatal error: Uncaught Error: Call to a member function getUsername() on null in /var/www/html/lib/pkp/classes/services/PKPSubmissionFileService.inc.php:321
Stack trace:
#0 /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFileFilter.inc.php(207): PKP\Services\PKPSubmissionFileService->add(Object(SubmissionFile), Object(Request))
#1 /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeImportFilter.inc.php(60): NativeXmlSubmissionFileFilter->handleElement(Object(DOMElement))
#2 /var/www/html/lib/pkp/classes/filter/Filter.inc.php(449): NativeImportFilter->process(Object(DOMDocument))
#3 /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFilter.inc.php(169): Filter->execute(Object(DOMDocument))
#4 /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFilter.inc.php(127): NativeXmlSubmissionFilter->parseSubmissionFile(Object(DOMElement), Object(Submission))
#5 /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFilter.inc in /var/www/html/lib/pkp/classes/services/PKPSubmissionFileService.inc.php on line 321
I suspected some error with the XML, but it seems to validate:
xmllint journala-issue-17.xml --schema /var/www/html/plugins/importexport/native/native.xsd --noout
journala-issue-17.xml validates
For the sake of it, I tried another issue without any articles and this succeeded. I then tried exporting and importing two issues from and to JournalB. Again, the empty one succeeded, the other failed.
So I suppose the problem lies within the article metadata somehow. Can anyone give me a hint about what to look for? Or do I simply have a misunderstanding of what is supposed to happen?
Many thanks and best regards
Dennis