pkp / jatsTemplate

Basic JATS document template generator plugin for OJS
GNU General Public License v3.0
9 stars 13 forks source link

Uncaught TypeError on remote galley URL #58

Closed SquishyLeaf closed 3 weeks ago

SquishyLeaf commented 3 weeks ago

When listing OAI records in JATS format, white page appears, and Apache logger shows the following error:

`` [Thu Oct 31 13:36:48.458147 2024] [php:error] [pid 663:tid 663] [client 10.0.2.2:52761] PHP Fatal error: Uncaught TypeError: PKP\\submissionFile\\Repository::get(): Argument #1 ($id) must be of type int, null given, called in /var/www/html/plugins/generic/jatsTemplate/JatsTemplatePlugin.php on line 292 and defined in /var/www/html/lib/pkp/classes/submissionFile/Repository.php:76\nStack trace:\n#0 /var/www/html/plugins/generic/jatsTemplate/JatsTemplatePlugin.php(292): PKP\\submissionFile\\Repository->get()\n#1 /var/www/html/plugins/generic/jatsTemplate/JatsTemplatePlugin.php(70): APP\\plugins\\generic\\jatsTemplate\\JatsTemplatePlugin->toXml()\n#2 [internal function]: APP\\plugins\\generic\\jatsTemplate\\JatsTemplatePlugin->callbackFindJats()\n#3 /var/www/html/lib/pkp/classes/plugins/Hook.php(139): call_user_func_array()\n#4 /var/www/html/lib/pkp/classes/plugins/Hook.php(113): PKP\\plugins\\Hook::run()\n#5 /var/www/html/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.php(65): PKP\\plugins\\Hook::call()\n#6 /var/www/html/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.php(107): APP\\plugins\\oaiMetadataFormats\\oaiJats\\OAIMetadataFormat_JATS->_findJats()\n#7 /var/www/html/lib/pkp/classes/oai/OAI.php(825): APP\\plugins\\oaiMetadataFormats\\oaiJats\\OAIMetadataFormat_JATS->toXml()\n#8 /var/www/html/lib/pkp/classes/oai/OAI.php(566): PKP\\oai\\OAI->formatMetadata()\n#9 /var/www/html/lib/pkp/classes/oai/OAI.php(95): PKP\\oai\\OAI->ListRecords()\n#10 /var/www/html/pages/oai/OAIHandler.php(47): PKP\\oai\\OAI->execute()\n#11 [internal function]: APP\\pages\\oai\\OAIHandler->index()\n#12 /var/www/html/lib/pkp/classes/core/PKPRouter.php(334): call_user_func()\n#13 /var/www/html/lib/pkp/classes/core/PKPPageRouter.php(278): PKP\\core\\PKPRouter->_authorizeInitializeAndCallRequest()\n#14 /var/www/html/lib/pkp/classes/core/Dispatcher.php(165): PKP\\core\\PKPPageRouter->route()\n#15 /var/www/html/lib/pkp/classes/core/PKPApplication.php(395): PKP\\core\\Dispatcher->dispatch()\n#16 /var/www/html/index.php(21): PKP\\core\\PKPApplication->execute()\n#17 {main}\n thrown in /var/www/html/lib/pkp/classes/submissionFile/Repository.php on line 76 ``

This happens on OJS 3.4.0-7 with JATS Template Plugin 1.0.7.2. Looks like this is a similar issue to https://github.com/pkp/oaiJats/issues/52 as applying this fix https://github.com/pkp/oaiJats/commit/7df59ee996b45f5ccf937157b9c0004a335fdd6b to line 292 in JatsTemplatePlugin.php also fixes it for me.

asmecher commented 3 weeks ago

Fixed, thanks!