When importing an issue exported from another OJS instance, it is failing with the error:
# php tools/importExport.php NativeImportExportPlugin import /tmp/issue.xml journal admin
PHP Notice: Undefined offset: -1 in /var/www/html/plugins/importexport/native/filter/NativeXmlSupplementaryFileFilter.inc.php on line 78
PHP Fatal error: Call to a member function setDescription() on null in /var/www/html/plugins/importexport/native/filter/NativeXmlSupplementaryFileFilter.inc.php on line 78
I have upgraded OJS I am importing into from 3.1.0.0 to 3.1.0.1 so both source and destination are running the latest 3.x version. Running the importer again, I get the same error on the command line:
# php5.6 tools/importExport.php NativeImportExportPlugin import /tmp/issue.xml journal admin
PHP Notice: Undefined offset: -1 in /var/www/html/plugins/importexport/native/filter/NativeXmlSupplementaryFileFilter.inc.php on line 78
PHP Fatal error: Call to a member function setDescription() on null in /var/www/html/plugins/importexport/native/filter/NativeXmlSupplementaryFileFilter.inc.php on line 78
It looks like the issue imports as I can see something in Back Issues but it has no title, I get Vol No () and there is no information within the issue (no galley, issue data, etc). The number of items are correct.
Trying to import a different issue gives me a different set of warnings and no Back Issue is created:
PHP Warning: DOMDocument::loadXML(): Memory allocation failed : growing buffer in /var/www/html/lib/pkp/classes/xslt/XMLTypeDescription.inc.php on line 120
PHP Warning: DOMDocument::loadXML(): Memory allocation failed : growing buffer in /var/www/html/lib/pkp/classes/xslt/XMLTypeDescription.inc.php on line 120
PHP Warning: DOMDocument::schemaValidate(): The document has no document element. in /var/www/html/lib/pkp/classes/xslt/XMLTypeDescription.inc.php on line 133
I have also tried through the web ui. The first error was memory related so I pumped it to 512M to solve it:
[Fri Dec 22 15:42:04.834889 2017] [:error] [pid 1575] [client 121.44.38.108:48092] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 49514751 bytes) in /var/www/html/lib/pkp/classes/db/DAO.inc.php on line 87, referer: .../journal/management/importexport/plugin/NativeImportExportPlugin
Next I got:
[Fri Dec 22 15:43:05.709933 2017] [:error] [pid 1778] [client 121.44.38.108:48184] PHP Fatal error: Call to a member function setDescription() on null in /var/www/html/plugins/importexport/native/filter/NativeXmlSupplementaryFileFilter.inc.php on line 78, referer: …/journal/management/importexport/plugin/NativeImportExportPlugin
This results in the same as the command line outcome, I.e. an empty issue with no name (Vol No ()).
We’re not using it to upgrade OJS contents, we’re using it to import back issues that were added to another journal. Rather than have two separate journals, we would like to consolidate everything into one.
PHP Fatal error: Call to a member function setDescription() on null in /var/www/html/plugins/importexport/native/filter/NativeXmlSupplementaryFileFilter.inc.php on line 78, referer: …/journal/management/importexport/plugin/NativeImportExportPlugin
Could someone turn on the show_stacktrace setting in config.inc.php, trigger the error, and post the resulting stack trace?
Regards,
Alec Smecher
Public Knowledge Project Team
Above statements are from OJS configurations with show_stacktrace = on.
I re-ran to check again and the output in the logs is the same:
[Mon Jan 08 07:58:10.209167 2018] [:error] [pid 2075] [client 121.44.38.108:47580] PHP Notice: Undefined offset: -1 in /var/www/html/plugins/importexport/native/filter/NativeXmlSupplementaryFileFilter.inc.php on line 78, referer: http://.../management/importexport/plugin/NativeImportExportPlugin
[Mon Jan 08 07:58:10.209291 2018] [:error] [pid 2075] [client 121.44.38.108:47580] PHP Fatal error: Call to a member function setDescription() on null in /var/www/html/plugins/importexport/native/filter/NativeXmlSupplementaryFileFilter.inc.php on line 78, referer: http://.../management/importexport/plugin/NativeImportExportPlugin
Further to my above post, I have tracked down the problem:
File is: plugins/importexport/native/filter/NativeXmlArticleFilter.inc.php
Line 65
The method getByAbbrev is returning null (I’m assuming it should find the section which corresponds with the section_ref). The section does exist in the xml but is it the case that it is not being created in the db prior to the article xml element being parsed?
The description tag has a locale. When NativeXmlSupplementaryFileFilter’s handleChildElement is called, Line 73, description is handled by the if conditional. This conditional has an empty array on Line 78, $submissionFiles so the $setterFunction call fails trying to call a method on null. I tried working out what $submissionFiles should be populated with but it looks like it is always empty.
You have tried to import an issue, correct? In that issue import XML, the sections part comes before articles part, correct? Was there a section element with that abbrev element (that was referenced in that article element) in that XML file, e.g.: