Skip to content

Error when no keywords are present #19

Description

@paulo-graca

I'm getting this error when the publication doesn't have keywords:

Fatal error: Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in /usr/local/ojs/ojs-3.3.0-21/plugins/generic/openAIRE/OAIMetadataFormat_OpenAIRE.inc.php:199 Stack trace: #0 /usr/local/ojs/ojs-3.3.0-21/plugins/generic/openAIRE/OAIMetadataFormat_OpenAIRE.inc.php(199): explode() #1 /usr/local/ojs/ojs-3.3.0-21/lib/pkp/classes/oai/OAI.inc.php(790): OAIMetadataFormat_OpenAIRE->toXml() #2 /usr/local/ojs/ojs-3.3.0-21/lib/pkp/classes/oai/OAI.inc.php(246): OAI->formatMetadata() #3 /usr/local/ojs/ojs-3.3.0-21/lib/pkp/classes/oai/OAI.inc.php(75): OAI->GetRecord() #4 /usr/local/ojs/ojs-3.3.0-21/pages/oai/OAIHandler.inc.php(39): OAI->execute() #5 /usr/local/ojs/ojs-3.3.0-21/lib/pkp/classes/core/PKPRouter.inc.php(397): OAIHandler->index() #6 /usr/local/ojs/ojs-3.3.0-21/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest() #7 /usr/local/ojs/ojs-3.3.0-21/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route() #8 /usr/local/ojs/ojs-3.3.0-21/lib/pkp/classes/core/PKPApplication.inc.php(360): Dispatcher->dispatch() #9 /usr/local/ojs/ojs-3.3.0-21/index.php(68): PKPApplication->execute() #10 {main} thrown in /usr/local/ojs/ojs-3.3.0-21/plugins/generic/openAIRE/OAIMetadataFormat_OpenAIRE.inc.php on line 199

I found out that by validating it with a is_string($subject), it works as expected.
To test it, you should have a publication without keywords. Something like this:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions