[OJS 3.1.2] PKP PN Plugin error - Failed Ajax request or invalid JSON returned [close]

798e7209a154fa4de72a4d50d20f30a3c4628615_2_690x130
update the pkp plugin (PLN) and now I get this error in my modules it doesn’t appear either, it only appears in the galaria module, it appears to me as if it was installed

Hi @asmecher,

After trying many things, for me the solution was to upgrade the PHP version on my server from PHP 7.2 to PHP 7.3. now it works very well.

Hi @asmecher,

I’m having an error checking the warehouses in the local status says Packaging Failure, in all my magazines. Check the readme of the plugin and I see that the configuration is fine. I don’t know what else it could be.

image

Or this could be associated with an error that I get when trying to export an issue from the Native XML Plugin that shows me a 500 error and the following appears:

PHP Fatal error:  Uncaught Error: Call to a member function getAttribute() on null in /var/www/html/site.revistas.udea.edu.co/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php:293\nStack trace:\n#0 /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php(107): SubmissionNativeXmlFilter->addFiles(Object(DOMDocument), Object(DOMElement), Object(PublishedArticle))\n#1 /var/www/html/site.revistas/plugins/importexport/native/filter/ArticleNativeXmlFilter.inc.php(61): SubmissionNativeXmlFilter->createSubmissionNode(Object(DOMDocument), Object(PublishedArticle))\n#2 /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php(65): ArticleNativeXmlFilter->createSubmissionNode(Object(DOMDocument), Object(PublishedArticle))\n#3 /var/www/html/site.revistas/lib/pkp/classes/filter/Filter.inc.php(449): SubmissionNativeXmlFilter->process(Array)\n#4 /var/www/html/site.revistas.udea.ed in /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php on line 293, referer: https://revistas/index.php/prueba/management/importexport/plugin/NativeImportExportPlugin

Hi @diegomejia07 ,

This appears to be a data error; it’s the same problem described here: Native XML export - #7 by florianruckelshausen

Regards,
Alec

Hi @asmecher ,

Yes, I understand but there is no solution for this problem. What can I do there or how do I solve this problem?

Hi @diegomejia07,

Did you try exporting that issue through the native import/export plugin?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

Yes, but it shows me the error that I sent you in the last message.

PHP Fatal error:  Uncaught Error: Call to a member function getAttribute() on null in /var/www/html/site.revistas.udea.edu.co/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php:294\nStack trace:\n#0 /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php(107): SubmissionNativeXmlFilter->addFiles(Object(DOMDocument), Object(DOMElement), Object(PublishedArticle))\n#1 /var/www/html/site.revistas/plugins/importexport/native/filter/ArticleNativeXmlFilter.inc.php(61): SubmissionNativeXmlFilter->createSubmissionNode(Object(DOMDocument), Object(PublishedArticle))\n#2 /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php(65): ArticleNativeXmlFilter->createSubmissionNode(Object(DOMDocument), Object(PublishedArticle))\n#3 /var/www/html/site.revistas/lib/pkp/classes/filter/Filter.inc.php(449): SubmissionNativeXmlFilter->process(Array)\n#4 /var/www/html/site.revistas.udea.ed in /var/www/html/site.revistaso/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php on line 294, referer: https://revistas/index.php/prueba/management/importexport/plugin/NativeImportExportPlugin

Hi @diegomejia07,

Is there anything further/relevant in your PHP error log?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

No, it only shows me other messages that are Notice. It does not show me any other relevant error or message.

PHP Notice: Only variables should be passed by reference in /var/www/html/site.revistas/plugins/importexport/native/filter/IssueNativeXmlFilter.inc.php on line 219, referer: https://revistas/index.php/prueba/management/importexport/plugin/NativeImportExportPlugin
[Thu Feb 04 15:11:44.098769 2021] [php7:notice] [pid 29110] [client 200.24.17.147:10400] PHP Notice: Only variables should be passed by reference in /var/www/html/site.revistas/plugins/importexport/native/filter/IssueNativeXmlFilter.inc.php on line 198, referer: https://revistas/index.php/prueba/management/importexport/plugin/NativeImportExportPlugin
[Thu Feb 04 15:11:44.155563 2021] [php7:notice] [pid 29110] [client 200.24.17.147:10400] PHP Notice: Trying to get property ‘documentElement’ of non-object in /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php on line 294, referer: https://revistas/index.php/prueba/management/importexport/plugin/NativeImportExportPlugin
[Thu Feb 04 15:11:44.155727 2021] [php7:error] [pid 29110] [client 200.24.17.147:10400] PHP Fatal error: Uncaught Error: Call to a member function getAttribute() on null in /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php:294\nStack trace:\n#0 /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php(107): SubmissionNativeXmlFilter->addFiles(Object(DOMDocument), Object(DOMElement), Object(PublishedArticle))\n#1 /var/www/html/site.revistas/plugins/importexport/native/filter/ArticleNativeXmlFilter.inc.php(61): SubmissionNativeXmlFilter->createSubmissionNode(Object(DOMDocument), Object(PublishedArticle))\n#2 /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php(65): ArticleNativeXmlFilter->createSubmissionNode(Object(DOMDocument), Object(PublishedArticle))\n#3 /var/www/html/site.revistas/lib/pkp/classes/filter/Filter.inc.php(449): SubmissionNativeXmlFilter->process(Array)\n#4 /var/www/html/site.revistas.udea.ed in /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php on line 294, referer: https://revistas/index.php/prueba/management/importexport/plugin/NativeImportExportPlugin

Hi @asmecher,

I also check this other post, and I see in the query that I have several rows that this query brings me. What should be done there about it.

Hi @asmecher,

Could you help me solve this problem. I really need to figure it out.

Thank you.

Hi @diegomejia07,

If you see results for the query…

SELECT sf.* FROM submission_files sf LEFT JOIN users u ON (sf.uploader_user_id = u.user_id) WHERE u.user_id IS NULL;

…then it means that you have submission files were uploaded by a nonexistent user. To correct that, set the uploader_user_id for each of the resulting enries in submission_files to a valid user_id from the users table.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I do not see results in this query. What else can I do.

Hi @diegomejia07,

How did you resolve the data errors? It sounds like you used to have results for that query but now do not.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Set uploader_user_id for each of the resulting entries in submission_files a valid user_id value from the users table, but the same error continues to appear in the plugin PLN.

image

And when I try to export the issue via the native import/export plugin I get the following error.

PHP Fatal error:  Uncaught Error: Call to a member function getAttribute() on null in /var/www/html/site.revistas.udea.edu.co/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php:294\nStack trace:\n#0 /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php(107): SubmissionNativeXmlFilter->addFiles(Object(DOMDocument), Object(DOMElement), Object(PublishedArticle))\n#1 /var/www/html/site.revistas/plugins/importexport/native/filter/ArticleNativeXmlFilter.inc.php(61): SubmissionNativeXmlFilter->createSubmissionNode(Object(DOMDocument), Object(PublishedArticle))\n#2 /var/www/html/site.revistas/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php(65): ArticleNativeXmlFilter->createSubmissionNode(Object(DOMDocument), Object(PublishedArticle))\n#3 /var/www/html/site.revistas/lib/pkp/classes/filter/Filter.inc.php(449): SubmissionNativeXmlFilter->process(Array)\n#4 /var/www/html/site.revistas.udea.ed in /var/www/html/site.revistaso/lib/pkp/plugins/importexport/native/filter/SubmissionNativeXmlFilter.inc.php on line 294, referer: https://revistas/index.php/prueba/management/importexport/plugin/NativeImportExportPlugin

I don’t know what else I could do and I really need this plugin to work.

Hi @diegomejia07,

You’ll need to modify the code a little bit to get information about the data error.

In lib/pkp/classes/xslt/XMLTypeDescription.inc.php, you’ll see the following around line 133:

if (!$xmlDom->schemaValidate($this->_validationSource)) return false;

Try changing this to…

if (!$xmlDom->schemaValidate($this->_validationSource)) {
    error_log('Export error: ' . print_r(libxml_get_errors(), true));
    return false;
}

Then trigger the error again by attempting to export the problem submission, and check your PHP error log for details.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I did what it told me, and it shows me the following error:

 Export error: Array\n(\n    [0] => LibXMLError Object\n        (\n            [level] => 2\n            [code] => 1839\n            [column] => 0\n            [message] => Element '{http://pkp.sfu.ca}name', attribute 'locale': [facet 'pattern'] The value 'es_Es' is not accepted by the pattern '[a-z][a-z]_[A-Z][A-Z](@[a-z]+)?'.\n\n            [file] => \n            [line] => 0\n        )\n\n    [1] => LibXMLError Object\n        (\n            [level] => 2\n            [code] => 1824\n            [column] => 0\n            [message] => Element '{http://pkp.sfu.ca}name', attribute 'locale': 'es_Es' is not a valid value of the atomic type '{http://pkp.sfu.ca}locale'.\n\n            [file] => \n            [line] => 0\n        )\n\n)\n, referer: /pr/management/importexport/plugin/NativeImportExportPlugin

Hi @diegomejia07,

This indicates that there is a locale code of es_Es in the database – this is a typo; it should be es_ES. I suspect this is either from an XML import containing a mistake, or from manual editing of the database. Check in particular the locale column of submission_file_settings.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

If indeed in the locale column of the submission_file_settings table, this es_Es and not es_ES. What can I do there, update the column or how can I solve it?

Hi @diegomejia07,

This is your data, not ours, so you’ll need to go hunting for it :slight_smile:

If you’re not familiar with SQL, you can usually access and modify the database easily using a tool like phpMyAdmin. Make sure to take a backup before working with the database directly.

Regards,
Alec Smecher
Public Knowledge Project Team