Error: Call to a member function getData() on null after trying to import

Hi,

I was trying to test the import/export function. I exported a submission, and tryed to import it again. After that , I’m becoming unexpected error on the interface and the following log:

[Sun Apr 12 00:17:56.978273 2020] [php7:notice] [pid 4787] [client 186.235.10.74:38262] Slim Application Error:\nType: Error\nMessage: Call to a member function getData() on null\nFile: /var/www/html/anaiseneds/lib/pkp/classes/submission/PKPSubmission.inc.php\nLine: 54\nTrace: #0 /var/www/html/anaiseneds/classes/services/GalleyService.inc.php(137): PKPSubmission->getBestId()\n#1 /var/www/html/anaiseneds/classes/services/GalleyService.inc.php(249): APP\Services\GalleyService->getProperties(Object(ArticleGalley), Array, Array)\n#2 /var/www/html/anaiseneds/lib/pkp/classes/services/PKPPublicationService.inc.php(208): APP\Services\GalleyService->getSummaryProperties(Object(ArticleGalley), Array)\n#3 [internal function]: PKP\Services\PKPPublicationService->PKP\Services\{closure}(Object(ArticleGalley))\n#4 /var/www/html/anaiseneds/lib/pkp/classes/services/PKPPublicationService.inc.php(210): array_map(Object(Closure), Array)\n#5 /var/www/html/anaiseneds/lib/pkp/classes/services/PKPPublicationService.inc.php(235): PKP\Services\PKPPublicationService->getProperties(Object(Publication), Array, Array)\n#6 /var/www/html/anaiseneds/lib/pkp/classes/services/PKPSubmissionService.inc.php(204): PKP\Services\PKPPublicationService->getSummaryProperties(Object(Publication), Array)\n#7 [internal function]: PKP\Services\PKPSubmissionService->PKP\Services\{closure}(Object(Publication))\n#8 /var/www/html/anaiseneds/lib/pkp/classes/services/PKPSubmissionService.inc.php(208): array_map(Object(Closure), Array)\n#9 /var/www/html/anaiseneds/lib/pkp/classes/services/PKPSubmissionService.inc.php(297): PKP\Services\PKPSubmissionService->getProperties(Object(Submission), Array, Array)\n#10 /var/www/html/anaiseneds/lib/pkp/api/v1/_submissions/PKPBackendSubmissionsHandler.inc.php(158): PKP\Services\PKPSubmissionService->getBackendListProperties(Object(Submission), Array)\n#11 [internal function]: PKPBackendSubmissionsHandler->getMany(Object(Slim\Http\Request), Object(APIResponse), Array)\n#12 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(APIResponse), Array)\n#13 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(APIResponse), Array)\n#14 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Slim\Http\Request), Object(APIResponse))\n#15 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))\n#16 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(APIResponse))\n#17 /var/www/html/anaiseneds/lib/pkp/classes/security/authorization/internal/ApiAuthorizationMiddleware.inc.php(76): Slim\App->__invoke(Object(Slim\Http\Request), Object(APIResponse))\n#18 [internal function]: ApiAuthorizationMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))\n#19 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiAuthorizationMiddleware), Array)\n#20 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))\n#21 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))\n#22 /var/www/html/anaiseneds/lib/pkp/classes/security/authorization/internal/ApiCsrfMiddleware.inc.php(46): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))\n#23 [internal function]: ApiCsrfMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#24 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiCsrfMiddleware), Array)\n#25 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#26 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#27 /var/www/html/anaiseneds/lib/pkp/classes/security/authorization/internal/ApiTokenDecodingMiddleware.inc.php(82): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))\n#28 [internal function]: ApiTokenDecodingMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#29 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiTokenDecodingMiddleware), Array)\n#30 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#31 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#32 /var/www/html/anaiseneds/lib/pkp/classes/handler/APIHandler.inc.php(68): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))\n#33 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#34 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)\n#35 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#36 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#37 /var/www/html/anaiseneds/lib/pkp/classes/handler/APIHandler.inc.php(127): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))\n#38 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#39 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)\n#40 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#41 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#42 /var/www/html/anaiseneds/lib/pkp/classes/handler/APIHandler.inc.php(132): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))\n#43 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#44 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)\n#45 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#46 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#47 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))\n#48 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))\n#49 /var/www/html/anaiseneds/lib/pkp/classes/handler/APIHandler.inc.php(124): Slim\App->process(Object(Slim\Http\Request), Object(APIResponse))\n#50 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#51 /var/www/html/anaiseneds/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_us
[Sun Apr 12 00:17:56.980390 2020] [:error] [pid 4787] [client 186.235.10.74] ModSecurity: Audit log: Failed to lock global mutex: Permission denied [hostname “anaiseneds.eita.coop.br”] [uri “/index.php/anais/api/v1/_submissions”] [unique_id “XpJeNH8AAAEAABJfEn8AAAAI”]
[Sun Apr 12 00:17:56.980610 2020] [:error] [pid 4787] [client 186.235.10.74] ModSecurity: Audit log: Failed to unlock global mutex: Permission denied [hostname “anaiseneds.eita.coop.br”] [uri “/index.php/anais/api/v1/_submissions”] [unique_id “XpJeNH8AAAEAABJfEn8AAAAI”]

How can I get rid of this? It is just a test installation, and I cannot even delete the papers.

best,
alan

Hi @alantygel,

Which application are you using, and what version? (Please include this in your posts.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

I’m sorry for that.

I’m using OJS 3.2.0-2, hosted on a Ubuntu 16.04 server, php7.3, apache2, mysql 5.7.

Hi @alantygel,

It looks like you imported submissions without publications. Was this hand-rolled XML, or exported from an OJS installation?

Regards,
Alec Smecher
Public Knowledge Project Team

Hello there @asmecher!
I am facing the same issue. I fresh installed ojs 3.2.0-2 and copied my data from other backup to this database. After that I am unable to pass through login stage. Login is successful but then I get the same error mentioned in this post and submissions do not load…
Please help me regarding this, as it is very important for me to make this portal live as soon as possible.
PHP is 7.3
MySql 8.0.xxx
OJS 3.2.0-2

Regards,

@asmecher
This is the full error message:
PHP Fatal error: Uncaught Error: Call to a member function getData() on null in E:\websites\ojs-3.2.0-2\lib\pkp\classes\submission\PKPSubmission.inc.php:54
Stack trace:
#0 E:\websites\ojs-3.2.0-2\classes\services\SubmissionService.inc.php(134): PKPSubmission->getBestId()
#1 E:\websites\ojs-3.2.0-2\lib\pkp\classes\plugins\HookRegistry.inc.php(107): APP\Services\SubmissionService->modifyPropertyValues(‘Submission::get…’, Array)
#2 E:\websites\ojs-3.2.0-2\lib\pkp\classes\services\PKPSubmissionService.inc.php(254): HookRegistry::call(‘Submission::get…’, Array)
#3 E:\websites\ojs-3.2.0-2\lib\pkp\classes\services\PKPSubmissionService.inc.php(297): PKP\Services\PKPSubmissionService->getProperties(Object(Submission), Array, Array)
#4 E:\websites\ojs-3.2.0-2\lib\pkp\classes\components\listPanels\PKPSubmissionsListPanel.inc.php(186): PKP\Services\PKPSubmissionService->getBackendListProperties(Object(Submission), Array)
#5 E:\websites\ojs-3.2.0-2\lib\pkp\pages\dashboard\DashboardHandler.inc.php(76): PKP\components\listPanels\PKPSubmissionsListPanel->getItems(Object(Request))
#6 E:\websites\ojs-3.2.0-2\lib\pkp\classes\core\PKPRouter.inc.php(391): DashboardHandler->index(Array, Object(Request))
#7 E:\websites\ojs-3.2.0-2\lib\pkp\classes\core\PKPPageRouter.inc.php(231): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#8 E:\websites\ojs-3.2.0-2\lib\pkp\classes\core\Dispatcher.inc.php(143): PKPPageRouter->route(Object(Request))
#9 E:\websites\ojs-3.2.0-2\lib\pkp\classes\core\PKPApplication.inc.php(278): Dispatcher->dispatch(Object(Request))
#10 E:\websites\ojs-3.2.0-2\index.php(68): PKPApplication->execute()
#11 {main}
thrown in E:\websites\ojs-3.2.0-2\lib\pkp\classes\submission\PKPSubmission.inc.php on line 54

1 Like

Hi,

Actually my dream was to export all my papers from (abandoned?) OCS to OJS (Is OCS still secure? Or: how can I migrate OCS to OJS? - #2 by alantygel). Since the first experiments on doing this shows that both XML schemas area completely different, I started from the begging doing a supposedly very simple test: export and import the very same article from the very same OJS instance back to itself.

And this was how I end up in this situation.

thanks for the attention, best regards.
alan

Hi @alantygel,

I had same issue and edit file: lib/pkp/classes/submission/PKPSubmission.inc.php

from line 53:

function getBestId() {
	return $this->getCurrentPublication() && $this->getCurrentPublication()->getData('urlPath')
		? $this->getCurrentPublication()->getData('urlPath')
		: $this->getId();
}

But still, my Subscription page is blank :confused:

(Cross-posted here: Potential issue · Issue #5942 · pkp/pkp-lib · GitHub)