PHP Fatal error: Uncaught TypeError: array_search(): Argument #2 ($haystack) must be of type array, null given in ... plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.php:133

Hi everyone,
I would like to report the following fatal error:

[18-Jul-2023 18:44:01 UTC] PHP Warning: Undefined array key “” in /home/seisense/journal.seisense.com/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.php on line 132

[18-Jul-2023 18:44:01 UTC] PHP Fatal error: Uncaught TypeError: array_search(): Argument #2 ($haystack) must be of type array, null given in /home/seisense/journal.seisense.com/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.php:133
Stack trace:
#0 /home/seisense/journal.seisense.com/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.php(133): array_search()
#1 /home/seisense/journal.seisense.com/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.php(162): APP\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS->_addChildInOrder()
#2 /home/seisense/journal.seisense.com/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.php(112): APP\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS->_mungeMetadata()
#3 /home/seisense/journal.seisense.com/lib/pkp/classes/oai/OAI.php(825): APP\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS->toXml()
#4 /home/seisense/journal.seisense.com/lib/pkp/classes/oai/OAI.php(566): PKP\oai\OAI->formatMetadata()
#5 /home/seisense/journal.seisense.com/lib/pkp/classes/oai/OAI.php(95): PKP\oai\OAI->ListRecords()
#6 /home/seisense/journal.seisense.com/pages/oai/OAIHandler.php(47): PKP\oai\OAI->execute()
#7 [internal function]: APP\pages\oai\OAIHandler->index()
#8 /home/seisense/journal.seisense.com/lib/pkp/classes/core/PKPRouter.php(334): call_user_func()
#9 /home/seisense/journal.seisense.com/lib/pkp/classes/core/PKPPageRouter.php(277): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest()
#10 /home/seisense/journal.seisense.com/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPPageRouter->route()
#11 /home/seisense/journal.seisense.com/lib/pkp/classes/core/PKPApplication.php(373): PKP\core\Dispatcher->dispatch()
#12 /home/seisense/journal.seisense.com/index.php(21): PKP\core\PKPApplication->execute()
#13 {main}
thrown in /home/seisense/journal.seisense.com/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.php on line 133

So far, I havnt noticed anything wrong wtih my OJS on the frontend. Does anyone know, why this appeared and the possible solution.

OJS: 3.4.0.1
PHP: 8.1

Thanks
seisense

Hi @seisense,

Are you working with submissions that have JATS documents associated with them? (For example, have you uploaded a JATS XML file to the submission workflow somewhere?)

If so, is it possible that you have an invalid/incomplete JATS document, such as something missing the root <article>...<front>...</front>...</article> elements?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,
Back in year 2018, we had published a few articles in XML (played with JATS XML) but then we dropped the idea of publishing XML. Since then we never uploaded any XML files in the submission system.

I have visited those articels where initially we experimented with JATS XML documents and uploaded articles in XML at the production stage. But even in those articels, I dont see any XML files any more at all.
Thanks
seisense

Hi @seisense,

I suspect there is still one hanging around somewhere, and it’s not parseable. In any case, if you’re not using JATS anymore, are you using the OAI JATS plugin? If not (i.e. nobody is harvesting your journal’s content over OAI using JATS) I’d suggest removing or disabling that plugin.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

This topic was automatically closed after 10 days. New replies are no longer allowed.