After upgrade to OJS 3.2.1.3 - ORCID plugin producing fatal error

Hi @Dulip_Withanage ,
Once again I am facing an issue with the ORCID plugin after I upgrade to 3.2.1.3. When author tries to authenticate the orcid following the link they receive in email, It throws the following fatal error:

[26-Jan-2021 04:27:55 America/New_York] PHP Fatal error:  Uncaught Error: Call to a member function getId() on null in /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php:304
Stack trace:
#0 /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php(343): OrcidProfilePlugin->buildOAuthUrl('orcidAuthorize', Array)
#1 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_filterhandler.php(63): OrcidProfilePlugin->registrationFilter('\t<!DOCTYPE html...', Object(Smarty_Internal_Template))
#2 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(231): Smarty_Internal_Runtime_FilterHandler->runFilter('output', '\t<!DOCTYPE html...', Object(Smarty_Internal_Template))
#3 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1)
#4 /home/seisense/journal.seisense.com/lib/pkp/lib/ven in /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php on line 304

And author receives the following error in the browser " The current role does not have access to this operation"

Basic info:
ORCID Plugin: 1.1.2.6
OJS : 3.2.1.3
PHP: 7.4

Looking forward to your support and solution.
Thanks

Hi @seisense ,

How does the link look like in your case ? Can you send me the links, (may be tokens anonymized)

Hi @Dulip_Withanage ,

Copied the section of the email which the author receives for authentication.

To confirm your authorship, please add your ORCID id to this submission by visiting the link provided below.

ORCID iD iconRegister or connect your ORCID iD

More information about ORCID at SEISENSE Business Review

did you change your email template, the variable orcidAuthURL under /management/settings/workflow should not include settings. This was earlier a problem in ojs, but shoud have been fixed in OJS. Can you confirm after checking it?

There should not be any settings before the varialbe name.
Screenshot from 2021-01-27 08-01-15

Hi @Dulip_Withanage,
I did not make any changes to orcidAuthURL. There are two email templates for ORCID. Find below the screenshot of both the email templates for your review
orcid1
orcid2

Thanks for your time and effort

I have this exact issue at the moment. If you don’t have ‘https://’ in the URL you are editing, OJS automatically appends the current settings page URL to the beginning of the link.

In my case, if I edit the authentication URL and set it to “{$authorOrcidURL}” and click save, the URL will be changed to “https://journal.nzpps.org/index.php/nzpp/management/settings/{$authorOrcidUrl}”.

I was having this issue with 3.2.1.1 and thought upgrading might fix it, but it didn’t. the only difference is that in 3.2.1.1 if I changed the URL to “https://{$authorOrcidUrl}” and clicked Save, the URL would be changed to “https://authororcidurl”. Now after upgrading to 3.2.1.3, “https://{$authorOrcidUrl}” will be reverted to “https://journal.nzpps.org/index.php/nzpp/management/settings/{$authorOrcidUrl}”.

These emails are giving the same errors for our authors, or sometimes simply a ‘404 Page Not Found’. The proper ORCiD URL is in there though, as I noticed that if I removed “https://journal.nzpps.org/index.php/nzpp/management/settings/{$href=” from the beginning of the link, the rest of the link worked as it should and took you to the ORCiD authentication page.

Here’s an example of a full URL that gets inserted into the emails sent to the author:

https://journal.nzpps.org/index.php/nzpp/management/settings/<a%20href=‘https:/orcid.org/oauth/authorize?client_id=APP-XXXXXXXXXXXX&response_type=code&scope=%2Fauthenticate&redirect_uri=https%3A%2F%2Fjournal.nzpps.org%2Findex.php%2Fnzpp%2Forcidapi%2ForcidVerify%3Ftoken%XXXXXXXXXXXXXXXXXXXXXXX%26publicationId%3D4419’%20class=‘authorOrcidUrl-style-class’>https://orcid.org/oauth/authorize?client_id=APP-XXXXXXXXXXXX&response_type=code&scope=%2Fauthenticate&redirect_uri=https%3A%2F%2Fjournal.nzpps.org%2Findex.php%2Fnzpp%2Forcidapi%2ForcidVerify%3Ftoken%XXXXXXXXXXXXXXXXXXXXXXX%26publicationId%3D4419</a>

Hi @galexioza ,

This was a general issue, we had with the OJS 3.2.

It is fixed after 17. November 2020 in the code.

Could you check with if you have the newset ui-library files are in the OJS installation ?

OJS_INSTALLATION/ui-library/src/components/Form/fields/FieldRichTextarea.vue

We are still experiencing the same problem after an upgrade to OJS 3.2.1-4. I have asked our systems administrator to check the ui-library files. This is very frustrating for our authors!Screen Shot 2021-02-08 at 10.34.57 am (2)

Hi Dulip,

We are still experiencing the same problem and our system admin has checked the ui-library files and they are correct. They have said that they have identified the problem but don’t know why it is happening (screengrab). Would you be able to offer some advice?

“The highlighted code returns ‘null’ value from the database.”

Thanks so much
Jacqueline2021-02-11_6-50-40

Hi Jacqueline,
this error shows that the token is not set in the settings. Did you also check that you have the newset plugin version and in the settings token and client-id are correctly configured?

Hi @Dulip_Withanage ,
Any specific thing to investigate in my case as I am still facing this issue. Looking forward to a solution.
Thanks

Hi Dulip,

Thanks for your reply. I have re-checked the plugin and it is up-to-date and the settings token and client-id are correctly configured. Any further thoughts?

Many thanks
Jacqueline

Hi Jacqueline,
Your report suggests to me that the token is not coming to ojs side.
is there a orcid.log created in your ojs files folder to check, if there is any communication error. If that does not indicate anything, please let me know.
Best,
Dulip

Unfortunately I can’t check this as the systems admin have advised it is outside their expertise and they can no longer help. They say they have followed PKP’s advice and upgraded the OJS, that the plugin is up to date and have identified that the issue is in the code highlighted in the screen grab I uploaded previously. So I am stuck.
Best
Jacqueline

@Dulip_Withanage ,
I have upgraded my OJS installation to 3.3.0-3 but still it is throwing the following error in PHP error log

[18-Feb-2021 15:49:56 America/New_York] PHP Fatal error:  Uncaught Error: Call to a member function getId() on null in /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php:304
Stack trace:
#0 /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php(343): OrcidProfilePlugin->buildOAuthUrl('orcidAuthorize', Array)
#1 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_filterhandler.php(63): OrcidProfilePlugin->registrationFilter('<!DOCTYPE html>...', Object(Smarty_Internal_Template))
#2 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(231): Smarty_Internal_Runtime_FilterHandler->runFilter('output', '<!DOCTYPE html>...', Object(Smarty_Internal_Template))
#3 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1)
#4 /home/seisense/journal.seisense.com/lib/pkp/lib/vendo in /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php on line 304

I have now ORCID version 1.1.2.8 installed.
Looking forward to the solution.
Thanks

Hi @seisense,

This has been filed here: Fatal error when used on site registration · Issue #164 · pkp/orcidProfile · GitHub

Regards,
Alec Smecher
Public Knowledge Project Team

Hi all,

I have released the following plugin versions.

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

These releases add the support for disabling the plugin, if there are issues with the client -id and client-secret defined by orcid-consortium

Please check whether updating the plugin captures your issue and let me know.

1 Like

I noticed the OJS plugin gallery was showing the update of ORCID plugin version 1.1.2.14.
After updating to the current version, it is still throwing fatal error at site wide registration:

[08-Mar-2021 12:18:50 America/New_York] PHP Warning:  assert(): assert($context != null) failed in /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php on line 303
[08-Mar-2021 12:18:50 America/New_York] PHP Fatal error:  Uncaught Error: Call to a member function getId() on null in /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php:304
Stack trace:
#0 /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php(343): OrcidProfilePlugin->buildOAuthUrl('orcidAuthorize', Array)
#1 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_filterhandler.php(63): OrcidProfilePlugin->registrationFilter('<!DOCTYPE html>...', Object(Smarty_Internal_Template))
#2 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(231): Smarty_Internal_Runtime_FilterHandler->runFilter('output', '<!DOCTYPE html>...', Object(Smarty_Internal_Template))
#3 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1)
#4 /home/seisense/journal.seisense.com/lib/pkp/lib/vendo in /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php on line 304

OJS: 3.3.0.3
PHP:7.14

\Thanks

Hi @seisense ,
could you please make a small gif or the url paths you click to produce this scenario ?

Hi @Dulip_Withanage ,
Please visit the link (SEISENSE) to my journal website. When you click on the “Register” in top menu, it shows php error 500 error. And in php error log it throws the following:

[09-Mar-2021 01:51:22 America/New_York] PHP Warning:  assert(): assert($context != null) failed in /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php on line 303
[09-Mar-2021 01:51:22 America/New_York] PHP Fatal error:  Uncaught Error: Call to a member function getId() on null in /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php:304
Stack trace:
#0 /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php(343): OrcidProfilePlugin->buildOAuthUrl('orcidAuthorize', Array)
#1 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_filterhandler.php(63): OrcidProfilePlugin->registrationFilter('<!DOCTYPE html>...', Object(Smarty_Internal_Template))
#2 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(231): Smarty_Internal_Runtime_FilterHandler->runFilter('output', '<!DOCTYPE html>...', Object(Smarty_Internal_Template))
#3 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1)
#4 /home/seisense/journal.seisense.com/lib/pkp/lib/vendo in /home/seisense/journal.seisense.com/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php on line 304

Hope it helps to figure out the issue.
Thanks