Article import fails with DB Error

Hi all,
I am using the Articles and Issues XML Plugin to import some data, but it is failing. Here is the error message:

DB Error: ERROR: invalid input syntax for integer: ""
Stack Trace:
File: /var/www/journals/classes/article/ line 245

Function: DAO->update("INSERT INTO article_supplementary_files (remote_url, file_id...", Array(7))

I am running OJS version 2.4.2 on RHEL 5.11 64-bit.

Would this be a problem with my data or the OJS setup?

THanks very much,

Hi @gizzard,

Have you tried validating your XML against the DTD?

Alec Smecher
Public Knowledge Project Team

Hi Alec,

Yes, I used xmllint and it validates.


If you don’t have access or experience with a PHP debugger, one lightweight but time intensive way of looking deeper into this would be to edit the XML to identify an example article which is causing the error, then identify the supplemental file in that article which is misbehaving. To do this, remove half of the article nodes from the XML, and retry the import. If it succeeds, try the other half. If it fails, remove half of the article nodes, etc. Once you have a particular article, look at the supplemental file nodes to see if any look odd.

Hi all,

There are a few candidates for data that, if left empty, would result in this problem. The most likely on is the type column. This should be specified in the XML on the supplemental_file node using the type attribute; if other, then the type_other child node should be specified.

Alec Smecher
Public Knowledge Project Team

Hi Alec and Clinton,

There was only one supplemental_file node with type=“research_materials”. I have tried importing in versions 2.4.2 and 2.4.6.

I’ll try Clinton’s suggestion of breaking the file down.


If there is only one supplemental_file node in the file, you might post that node here. Someone might be able to eyeball the missing piece.

Hi Clinton,

Here it is:

<supplemental_file type="research_materials" language="en">
    <title locale="en_US">Silence and Sound in the Sentences of Gerald Murnane’s A Million Windows</title>
    <creator locale="en_US">Anthony Uhlmann</creator>
    <subject locale="en_US">Gerald Murnane, silence, sound, meaning</subject>
    <description locale="en_US">Critical essay on Murnane's novel A Million Windows</description>
        <embed filename="Murnane in style.docx" encoding="base64" mime_type="application/vnd.openxmlformats-officedocument.wordprocessingml.document">

             [ base64-encoded text]


Thanks a lot,

I was able to insert this supplemental_file element into an article import and successfully load it under OJS 2.4.7. Please try my earlier suggestion to confirm that this is the actual element that is causing the error for you.