Call to a member function saveXml()

can this errors be, because i use 7.4 php instead of 7.3 or 7.2?

1 Like

The error seems to indicate that when the plugin tried to export a specific object, it ultimately couldn’t load that object. Then, when it tried to use the object, it was null, so the method saveXml() could not be called.

This is unlikely to be a PHP version issue. Rather, it will be a data/code issue. Specifically, the code is initially identifying an object (galley, submission, issue) to be exported, but then when it actually goes to export it, the object doesn’t load (perhaps because of inconsistent or invalid data).

My next step in this situation would be to identify which object was causing the problem, either by exporting one-by-one, or by debugging the code. Then, look carefully at the metadata properties for that galley/submission/issue. Is there anything odd about it?

In addition to @ctgraham’s comments here, I’ll mention that ultimately, the XML object that tries to get saved here is returned from the execute() method in lib/pkp/classes/filter/Filter.inc.php. You could try looking at the object there, or the $preliminaryOutput variable there, to see what you’ve got. As Clinton mentioned, if the resulting XML isn’t valid, you’ll get a null object.

Cheers,
Jason

@ctgraham thanks for your reply.

As i understand if i use clean code of OJS 3.2.0-1, i should search database, and lookup where no data? Updating from 3.1.2.-4 was made by php-cli command.

I wouldn’t have an immediate guess of what to look for directly within the database.

If you are comfortable debugging PHP, you can use step-through debugging or error_log() statements to evaluate the variables along the call stack described in the error message, especially the XML @jnugent mentions.

If you are not familiar with debugging PHP, export the objects one-by-one in the interface until you encounter the error. Then, examine whichever object created the error directly within the submission system. Does anything stand out?

@ctgraham

i’m not sure that i’m good debugger.

i have enable in config.inc.php
show_stacktrace = On
display_errors = On

i tryied from 1-st step, - creating and publishing issue.

i can create new issue, but when i try to publish it i receive:
[27-Mar-2020 18:52:32 Europe/Berlin] ojs2: Unrecognized DAO PublishedArticleDAO!

but when i change in DB setting “published” to “1” it became published.

I have create submission. it’s status is “Scheduled” but not “published”
my submission haven’t “locale” setting in “submission” table. i need to set it manualy. it has “null” before i change. also i change “status” from 5 to 3. and finaly it became published.

screenshot for null setting in locale: image

Hi all,

There’s currently an issue in the ORCID plugin that interferes with publishing an issue. See: [OJS] ORCID Profile Plugin prevents article publication · Issue #5572 · pkp/pkp-lib · GitHub

For the moment, I’d recommend disabling that plugin before publishing an issue (and re-enabling afterwards if you like). There will be an updated version of the plugin available soon in the plugin gallery.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

already disabled. issue can be published. but i think that smth in DB is missed for submission, and that’s the problem of deposition to OJS.

unfortunatly nothing helped.

but i catch popup message for depositing to doaj

Deposit was not successful! The DOAJ API returned an error: ‘1 - {“status”: “bad_request”, “error”: “Supplied data was not valid JSON (ref: 733e2f80-705d-11ea-a91b-6ac132d54a90)”}’.

and when i try to export XML
Stack trace:
#0 D:\xampp2\htdocs\classes\plugins\PubObjectsExportPlugin.inc.php(195): PubObjectsExportPlugin->exportXML(Array, ‘article=>doaj-x…’, Object(Journal), true)
#1 D:\xampp2\htdocs\plugins\importexport\doaj\DOAJExportPlugin.inc.php(196): PubObjectsExportPlugin->executeExportAction(Object(Request), Array, ‘article=>doaj-x…’, ‘exportSubmissio…’, ‘articles’, true)
#2 D:\xampp2\htdocs\classes\plugins\PubObjectsExportPlugin.inc.php(176): DOAJExportPlugin->executeExportAction(Object(Request), Array, ‘article=>doaj-x…’, ‘exportSubmissio…’, ‘articles’, true)
#3 D:\xampp2\htdocs\plugins\importexport\doaj\DOAJExportPlugin.inc.php(52): PubObjectsExportPlugin->display(Array, Object(Request))
#4 D:\xampp2\htdocs\lib\pkp\pages\management\PKPToolsHandler.inc.php(104): DOAJExportPlugin->display(Array, Object(Request))
#5 D:\xampp2\htdocs\lib\pkp\classes\core\PKPRouter.inc.php(3 in D:\xampp2\htdocs\classes\plugins\PubObjectsExportPlugin.inc.php on line 372

and for 3.1.2.4 all works fine

Hi @redukr,

There should be a line above “Stack trace:” that shows the actual error message.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher

[27-Mar-2020 20:01:59 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to a member function saveXml() on null in D:\xampp2\htdocs\classes\plugins\PubObjectsExportPlugin.inc.php:372

save as in 1-st post :frowning:

i know that my hands grow from my ass… but i will lost my mind :frowning:

1 Like

Hi @redukr,

i know that my hands grow from my ass

That is a beautiful phrase and I will borrow it :slight_smile:

What do you get for the following SQL query?

 select * from filter_groups where symbolic like 'article=>crossref-xml';

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher
6 article=>crossref-xml plugins.importexport.crossref.displayName plugins.importexport.crossref.description class::classes.article.Article[] xml::schema(https://www.crossref.org/schemas/crossref4.3.6.xsd)

image

and a minute of humor: Hands-ass deity
image

Hi @redukr,

I think that reference to Article is the problem – it changed starting with OJS 3.2.0 but it appears to not have been updated. Could you try the following two queries?

UPDATE filter_groups SET input_type = 'class::classes.submission.Submission[]' WHERE input_type = 'class::classes.article.Article[]';
UPDATE filter_groups SET output_type = 'class::classes.submission.Submission[]' WHERE output_type = 'class::classes.article.Article[]'

Please confirm whether that works and I’ll get it added to GitHub for the next release.

Regards,
Alec Smecher
Public Knowledge Project Team

UPDATE filter_groups SET input_type = ‘class::classes.submission.Submission[]’ WHERE input_type = ‘class::classes.article.Article[]’

Affected rows: 5
Time: 0,037s

UPDATE filter_groups SET output_type = ‘class::classes.submission.Submission[]’ WHERE output_type = ‘class::classes.article.Article[]’

Affected rows: 1
Time: 0,003s

YOHOOOOOOOO

For crossref

  1. Registration successful!
  2. downloading of XML successful to

for doaj:
Deposit was not successful! The DOAJ API returned an error: ‘1 - {“status”: “bad_request”, “error”: “Supplied data was not valid JSON (ref: bc1caeaa-7076-11ea-a926-6ac132d54a90)”}’.

and when i try to download xml:

    Warning: DOMDocument::schemaValidate(): Invalid Schema in D:\xampp2\htdocs\lib\pkp\classes\xslt\XMLTypeDescription.inc.php on line 134
Validation errors:
element decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) type definition.

attribute decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) simple type definition.

attribute decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) simple type definition.

attribute decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) simple type definition.

Invalid XML:
<?xml version="1.0" encoding="utf-8"?>
<records xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://doaj.org/static/doaj/doajArticles.xsd">
  <record>
    <language>eng</language>
    <publisher>Ukrainian Association of Researchers of Religion</publisher>
    <journalTitle>Українське Релігієзнавство</journalTitle>
    <issn>2306-3548</issn>
    <eissn>2617-9792</eissn>
    <publicationDate>2020-03-26</publicationDate>
    <issue>90</issue>
    <doi>10.32420/2020.90.2095</doi>
    <publisherRecordId>2049</publisherRecordId>
    <title language="eng">3.2.1-1 testing ojs</title>
    <title language="rus">3.2.1-1 testing ojs</title>
    <title language="ukr">3.2.1-1 testing ojs</title>
    <authors>
      <author>
        <name>Georgii  Fylypovych</name>
      </author>
    </authors>
    <abstract language="eng">
3.2.1-1 testing ojs
</abstract>
    <abstract language="rus">
3.2.1-1 testing ojs
</abstract>
    <abstract language="ukr">
3.2.1-1 testing ojs
</abstract>
    <fullTextUrl format="html">http://192.168.1.59/index.php/uars/article/view/2095</fullTextUrl>
    <keywords language="eng">
      <keyword>3.2.1-1 testing ojs</keyword>
    </keywords>
    <keywords language="rus">
      <keyword>3.2.1-1 testing ojs</keyword>
    </keywords>
    <keywords language="ukr">
      <keyword>3.2.1-1 testing ojs</keyword>
    </keywords>
  </record>
</records>
Could not convert selected objects.
Stack Trace:
File: D:\xampp2\htdocs\classes\plugins\PubObjectsExportPlugin.inc.php line 377
Function: ImportExportPlugin->displayXMLValidationErrors(Array(4), "<?xml version="1.0" encoding="utf-8"?> <records xmlns:xsi="http:...")

File: D:\xampp2\htdocs\classes\plugins\PubObjectsExportPlugin.inc.php line 195
Function: PubObjectsExportPlugin->exportXML(Array(1), "article=>doaj-xml", Object(Journal), False)

File: D:\xampp2\htdocs\plugins\importexport\doaj\DOAJExportPlugin.inc.php line 196
Function: PubObjectsExportPlugin->executeExportAction(Object(Request), Array(1), "article=>doaj-xml", "exportSubmissions-tab", "articles", False)

File: D:\xampp2\htdocs\classes\plugins\PubObjectsExportPlugin.inc.php line 176
Function: DOAJExportPlugin->executeExportAction(Object(Request), Array(1), "article=>doaj-xml", "exportSubmissions-tab", "articles", False)

File: D:\xampp2\htdocs\plugins\importexport\doaj\DOAJExportPlugin.inc.php line 52
Function: PubObjectsExportPlugin->display(Array(0), Object(Request))

File: D:\xampp2\htdocs\lib\pkp\pages\management\PKPToolsHandler.inc.php line 104
Function: DOAJExportPlugin->display(Array(1), Object(Request))

File: D:\xampp2\htdocs\lib\pkp\classes\core\PKPRouter.inc.php line 391
Function: PKPToolsHandler->importexport(Array(1), Object(Request))

File: D:\xampp2\htdocs\lib\pkp\classes\core\PKPPageRouter.inc.php line 231
Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(3), False)

File: D:\xampp2\htdocs\lib\pkp\classes\core\Dispatcher.inc.php line 143
Function: PKPPageRouter->route(Object(Request))

File: D:\xampp2\htdocs\lib\pkp\classes\core\PKPApplication.inc.php line 278
Function: Dispatcher->dispatch(Object(Request))

File: D:\xampp2\htdocs\index.php line 68
Function: PKPApplication->execute()

Hi @redukr,

Great! I’ve filed and fixed the CrossRef issue here:

For the DOAJ issue, I think you’re encountering a firewall problem or something similar that’s preventing OJS from contacting the DOAJ website for part of the schema description. See this thread: OJS3 XML doc error

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

@asmecher why doaj export works fine for 3.1.2-4 ?

Hi @redukr,

It may be that there are two problems here:

  • One with the DOAJ deposit process (Supplied data was not valid JSON), which I haven’t looked at yet, and
  • Another with the export XML (the invalid XML problem).

Can you confirm that you’re able to successfully perform both processes in OJS 3.1.2? Is your server behind a proxy, and if so, is it configured in your config.inc.php configuration file?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @redukr,

Ah, I’ve found the problem – DOAJ appears to have bumped one of the schema files on its server to a newer, incompatible version. I’ve filed this at DOAJ XML exports fail to validate · Issue #5682 · pkp/pkp-lib · GitHub and will look into a fix.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher my real website uars.info has frontend(nginx) which transfer all requests to another VM(with apache).
no additional configs in config.inc.php not enabled. version of OJS 3.1.2-4
and i can deposit data. i discovered that i can’t download xml because of the same error
i have install xampp at my work computer, and take there copy of current 3.1.2-4 site updated it to 3.2.0-1.

when i want to test deposition of metadata i change in my frontend IP.
location / {
proxy_pass https://192.168.1.90:443/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
}
}

Validation errors:
element decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) type definition.

attribute decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) simple type definition.

attribute decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) simple type definition.

attribute decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) simple type definition.

Invalid XML:
<?xml version="1.0" encoding="utf-8"?>
<records xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://doaj.org/static/doaj/doajArticles.xsd">
  <record>
    <language>ukr</language>
    <publisher>Ukrainian Association of Researchers of Religion</publisher>
    <journalTitle>Ukrainian Religious Studies</journalTitle>
    <issn>2306-3548</issn>
    <eissn>2617-9792</eissn>
    <publicationDate>2019-12-10</publicationDate>
    <issue>89</issue>
    <startPage>97</startPage>
    <endPage>101</endPage>
    <doi>10.32420/2019.89.1794</doi>
    <publisherRecordId>1794</publisherRecordId>
    <title language="ukr">Автори</title>
    <title language="eng">Authors of the journal</title>
    <authors>
      <author>
        <name>Editorial board  of the Journal </name>
      </author>
    </authors>
    <abstract language="ukr">
Автори
</abstract>
    <abstract language="eng">
Authors of the journal
</abstract>
    <fullTextUrl format="html">https://uars.info/index.php/uars/article/view/1794</fullTextUrl>
    <keywords language="ukr"/>
    <keywords language="eng"/>
    <keywords language="rus"/>
  </record>
</records>
Could not convert selected objects.