Error 500 on Trying to Import Issues/Articles - Native XML Plugin

I’m Trying to import issues/articles to OJS like other times, but now this happen:
captura_1
captura_2

On PHP error_log this appear
[26-May-2020 00:44:38 UTC] PHP Fatal error: Uncaught Error: Call to undefined method Publication::getLocale() in /home/ipebj/public_html/bjfs/lib/pkp/plugins/importexport/native/filter/NativeXmlPKPPublicationFilter.inc.php:138
Stack trace:
#0 /home/ipebj/public_html/bjfs/plugins/importexport/native/filter/NativeXmlPublicationFilter.inc.php(105): NativeXmlPKPPublicationFilter->handleChildElement(Object(DOMElement), Object(Publication))
#1 /home/ipebj/public_html/bjfs/lib/pkp/plugins/importexport/native/filter/NativeXmlPKPPublicationFilter.inc.php(95): NativeXmlPublicationFilter->handleChildElement(Object(DOMElement), Object(Publication))
#2 /home/ipebj/public_html/bjfs/plugins/importexport/native/filter/NativeXmlPublicationFilter.inc.php(44): NativeXmlPKPPublicationFilter->handleElement(Object(DOMElement))
#3 /home/ipebj/public_html/bjfs/lib/pkp/plugins/importexport/native/filter/NativeImportFilter.inc.php(60): NativeXmlPublicationFilter->handleElement(Object(DOMElement))
#4 /home/ipebj/public_html/bjfs/lib/pkp/classes/filter/Filter.inc.php(449): Native in /home/ipebj/public_html/bjfs/lib/pkp/plugins/importexport/native/filter/NativeXmlPKPPublicationFilter.inc.php on line 138

I use TSVConverter to convert my .XLSX to .XML, anyone can help me?

OJS version: 3.2.0.2

Hi @victormalves,

Converting from .xlsx to .xml using TSVConverter will not generate XML that is compatible with OJS. See ojs/export-issues.xml at stable-3_2_0 · pkp/ojs · GitHub for an example of XML that is compatible with OJS 3.2.0.

Regards,
Alec Smecher
Public Knowledge Project Team

I know, that’s why I modified the TSVConverter according to the native.xsd model (new), I imported a test using the model you showed me now and I have the same error. Can you help me?

Hi @victormalves,

Ah, OK – I misunderstood. Just to confirm, the import XML does validate per the XSD?

Thanks,
Alec Smecher
Public Knowledge Project Team

Yes! It was validated

@victormalves,

There is an issue filed for the problem you are experiencing. [Native ImportExport Plugin: Importing a localized publication causes an error · Issue #5920 · pkp/pkp-lib · GitHub].

There will be a fix for that issue soon.

Best Regards,
@Dimitris_Efstathiou

@victormalves could you please try the fix that the Native ImportExport Plugin: Importing a localized publication causes an error · Issue #5920 · pkp/pkp-lib · GitHub proposes to see if it solves the problem?

When import finish this appear on console log:

Uncaught SyntaxError: Unexpected token < in JSON at position 0
at Function.parse [as parseJSON] ()
at proxyConstructor.$.pkp.controllers.TabHandler.dataFilter (TabHandler.js?v=3.2.0.3:261)
at Object.dataFilter (Handler.js?v=3.2.0.3:304)
at ajaxConvert (jquery.js?v=3.2.0.3:8732)
at done (jquery.js?v=3.2.0.3:9255)
at XMLHttpRequest. (jquery.js?v=3.2.0.3:9548)

And when click to show more about this error:
Cannot instantiate class. Class "NativeXmlPublicationFilter" is not declared in "plugins.importexport.native.filter.NativeXmlPublicationFilter"

$.pkp.controllers.TabHandler.dataFilter @ TabHandler.js?v=3.2.0.3:261
(anonymous) @ Handler.js?v=3.2.0.3:304
ajaxConvert @ jquery.js?v=3.2.0.3:8732
done @ jquery.js?v=3.2.0.3:9255
(anonymous) @ jquery.js?v=3.2.0.3:9548
load (async)
send @ jquery.js?v=3.2.0.3:9567
ajax @ jquery.js?v=3.2.0.3:9206
load @ jquery-ui.js?v=3.2.0.3:18116
(anonymous) @ jquery-ui.js?v=3.2.0.3:144
_eventHandler @ jquery-ui.js?v=3.2.0.3:17896
(anonymous) @ jquery-ui.js?v=3.2.0.3:144
_activate @ jquery-ui.js?v=3.2.0.3:17980
(anonymous) @ jquery-ui.js?v=3.2.0.3:144
setOption @ jquery-ui.js?v=3.2.0.3:17549
(anonymous) @ jquery-ui.js?v=3.2.0.3:144
setOptions @ jquery-ui.js?v=3.2.0.3:427
option @ jquery-ui.js?v=3.2.0.3:418
(anonymous) @ jquery-ui.js?v=3.2.0.3:250
each @ jquery.js?v=3.2.0.3:354
each @ jquery.js?v=3.2.0.3:189
$.fn. @ jquery-ui.js?v=3.2.0.3:230
$.pkp.controllers.TabHandler.addTab @ TabHandler.js?v=3.2.0.3:366
$.pkp.classes.Handler.handleEvent @ Handler.js?v=3.2.0.3:253
dispatch @ jquery.js?v=3.2.0.3:5183
elemData.handle @ jquery.js?v=3.2.0.3:4991
trigger @ jquery.js?v=3.2.0.3:8249
(anonymous) @ jquery.js?v=3.2.0.3:8327
each @ jquery.js?v=3.2.0.3:354
each @ jquery.js?v=3.2.0.3:189
trigger @ jquery.js?v=3.2.0.3:8326
$.pkp.classes.Handler.triggerPublicEvent
@ Handler.js?v=3.2.0.3:754
$.pkp.classes.Handler.trigger @ Handler.js?v=3.2.0.3:627
(anonymous) @ Handler.js?v=3.2.0.3:380
(anonymous) @ underscore.js?v=3.2.0.3:73
.each..forEach @ underscore.js?v=3.2.0.3:153
$.pkp.classes.Handler.handleJson @ Handler.js?v=3.2.0.3:372
$.pkp.controllers.form.AjaxFormHandler.handleResponse @ AjaxFormHandler.js?v=3.2.0.3:122
$.pkp.classes.ObjectProxy.parent @ ObjectProxy.js?v=3.2.0.3:132
$.pkp.controllers.form.FileUploadFormHandler.handleResponse @ FileUploadFormHandler.js?v=3.2.0.3:100
(anonymous) @ Handler.js?v=3.2.0.3:304
fire @ jquery.js?v=3.2.0.3:3268
fireWith @ jquery.js?v=3.2.0.3:3398
done @ jquery.js?v=3.2.0.3:9305
(anonymous) @ jquery.js?v=3.2.0.3:9548
load (async)
send @ jquery.js?v=3.2.0.3:9567
ajax @ jquery.js?v=3.2.0.3:9206
jQuery. @ jquery.js?v=3.2.0.3:9355
$.pkp.controllers.form.AjaxFormHandler.submitForm @ AjaxFormHandler.js?v=3.2.0.3:82
(anonymous) @ Handler.js?v=3.2.0.3:304
$.pkp.controllers.form.FormHandler.submitHandler
@ FormHandler.js?v=3.2.0.3:490
(anonymous) @ Handler.js?v=3.2.0.3:304
s @ jquery.validate.min.js?v=3.2.0.3:2
(anonymous) @ jquery.validate.min.js?v=3.2.0.3:2
dispatch @ jquery.js?v=3.2.0.3:5183
elemData.handle @ jquery.js?v=3.2.0.3:4991

Feedback:
this “correction” generated an error, you can leave it as it was before! I was able to solve the problem simply by upgrading to the latest version.

Thanks a lot for the help!

Hi @victormalves. Glad you could fix your issue. Could you share your import file in order to try check your issue?

Thanks,
@Dimitris_Efstathiou

Dear @victormalves
could you please provide your version of the tsvConverter for OJS 3.2.+

Thank you so much and all the best
Klaus

Hi, I did a new release for the conversion script that supports 3.2.1 Have not checked yet what is needed for 3.3, but probably just minor changes. GitHub - ajnyga/tsvConverter: Excel to OJS3 XML conversion tool