Error when try register a new user from index page (ORCID bug?)

Hi there,
I’ve the follow error when an user try access the registering page from the home page (index):

PHP Fatal error:  Uncaught Error: Call to a member function getId() on null in /myhidepath/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php:318

This line is part of this block:

$request = PKPApplication::get()->getRequest();
$context = $request->getContext();
// This should only ever happen within a context, never site-wide.
assert($context != null);
$contextId = $context->getId(); //line 318 here
if ($this->isMemberApiEnabled($contextId)) {
$scope = ORCID_API_SCOPE_MEMBER;
} else {
$scope = ORCID_API_SCOPE_PUBLIC;
}

The same action works fine when the user click on Register from a specific journal homepage.

Someone knows a way to workaround this problem?

I’m using OJS 3.2.0.3.

Thanks so much.

Did you get any error in the frontend?

I found similar trouble with orcid when the http&httpS protocols are mixed, so be sure you ask for a redirect url (to orcid) and you set your base url (in your config.inc.php) in the same way.

In other words, to be safe, work in httpS all the time.

Hi @marc,

In the frontend literaly nothing (just blank screen). Thanks for your tip, but I’m working with https.

For now, my “solution” was to disable the ORCID plugin in the index registering and enable it only on the journal pages.

Ok. Flagging your post as a “solution” till we find a better one.

And pinging to @Dulip_Withanage (the plugin developer) to let him know.

Cheers,
m.

1 Like

Hi @plinio.garcia_ifc

I have released two versions in plugin-gallery, which should also address this issue.

OJS 3.1 Release v1_1_1-12 · pkp/orcidProfile · GitHub
OJS 3.2 Release v1_1_2-7 · pkp/orcidProfile · GitHub

Please test it and let me know if the problem still persists.

@marc thanks a lot for pinging.

1 Like