Open Vitaliy-1 opened 1 year ago
JATS Parser plugin doesn't set the ID of the user for a newly created submission file. This causes a fatal error in OJS main branch:
[Tue Dec 13 13:55:54 2022] Slim Application Error: Type: TypeError Message: PKP\user\Repository::get(): Argument #1 ($id) must be of type int, null given, called in /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/submissionFile/maps/Schema.php on line 180 File: /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/user/Repository.php Line: 48 Trace: #0 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/submissionFile/maps/Schema.php(180): PKP\user\Repository->get(NULL) #1 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/submissionFile/maps/Schema.php(53): PKP\submissionFile\maps\Schema->mapByProperties(Array, Object(PKP\submissionFile\SubmissionFile)) #2 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/galley/maps/Schema.php(117): PKP\submissionFile\maps\Schema->map(Object(PKP\submissionFile\SubmissionFile), Array) #3 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/galley/maps/Schema.php(57): PKP\galley\maps\Schema->mapByProperties(Array, Object(PKP\galley\Galley)) #4 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/galley/maps/Schema.php(82): PKP\galley\maps\Schema->summarize(Object(PKP\galley\Galley)) #5 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Collections/LazyCollection.php(730): PKP\galley\maps\Schema->PKP\galley\maps\{closure}(Object(PKP\galley\Galley), 0) #6 [internal function]: Illuminate\Support\LazyCollection->Illuminate\Support\{closure}() #7 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Collections/LazyCollection.php(105): iterator_to_array(Object(Generator)) #8 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(911): Illuminate\Support\LazyCollection->all() #9 [internal function]: Illuminate\Support\LazyCollection->jsonSerialize() #10 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/Http/Response.php(352): json_encode(Array, 0) #11 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/api/v1/_submissions/PKPBackendSubmissionsHandler.php(137): Slim\Http\Response->withJson(Array, 200) #12 [internal function]: PKP\API\v1\_submissions\PKPBackendSubmissionsHandler->getMany(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Array) #13 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(PKP\core\APIResponse), Array) #14 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(PKP\core\APIResponse), Array) #15 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #16 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #17 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #18 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/security/authorization/internal/ApiAuthorizationMiddleware.php(87): Slim\App->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #19 [internal function]: PKP\security\authorization\internal\ApiAuthorizationMiddleware->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Slim\App)) #20 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(PKP\security\authorization\internal\ApiAuthorizationMiddleware), Array) #21 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Slim\App)) #22 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Slim\App)) #23 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/security/authorization/internal/ApiCsrfMiddleware.php(54): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #24 [internal function]: PKP\security\authorization\internal\ApiCsrfMiddleware->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #25 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(PKP\security\authorization\internal\ApiCsrfMiddleware), Array) #26 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #27 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #28 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/security/authorization/internal/ApiTokenDecodingMiddleware.php(141): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #29 [internal function]: PKP\security\authorization\internal\ApiTokenDecodingMiddleware->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #30 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(PKP\security\authorization\internal\ApiTokenDecodingMiddleware), Array) #31 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #32 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #33 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/handler/APIHandler.php(77): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #34 [internal function]: PKP\handler\APIHandler->PKP\handler\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #35 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #36 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #37 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #38 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/handler/APIHandler.php(136): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #39 [internal function]: PKP\handler\APIHandler->PKP\handler\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #40 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #41 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #42 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #43 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/handler/APIHandler.php(141): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #44 [internal function]: PKP\handler\APIHandler->PKP\handler\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #45 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #46 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #47 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #48 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #49 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #50 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/handler/APIHandler.php(133): Slim\App->process(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #51 [internal function]: PKP\handler\APIHandler->PKP\handler\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #52 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #53 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #54 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #55 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/handler/APIHandler.php(141): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #56 [internal function]: PKP\handler\APIHandler->PKP\handler\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #57 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #58 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #59 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure)) #60 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #61 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #62 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/lib/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(PKP\core\APIResponse)) #63 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/core/APIRouter.php(127): Slim\App->run() #64 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/core/Dispatcher.php(163): PKP\core\APIRouter->route(Object(APP\core\Request)) #65 /Users/vitalii/Documents/development/ojs-main/ojs/lib/pkp/classes/core/PKPApplication.php(379): PKP\core\Dispatcher->dispatch(Object(APP\core\Request)) #66 /Users/vitalii/Documents/development/ojs-main/ojs/index.php(21): PKP\core\PKPApplication->execute() #67 {main} View in rendered output by enabling the "displayErrorDetails" setting.
According to submission_files table structure NULL are default values for that column. Consider an ID of the user, who conducts conversion, as a uploader_user_id for a converted PDF galley
NULL
uploader_user_id
JATS Parser plugin doesn't set the ID of the user for a newly created submission file. This causes a fatal error in OJS main branch:
According to submission_files table structure
NULL
are default values for that column. Consider an ID of the user, who conducts conversion, as auploader_user_id
for a converted PDF galley