pkp / orcidProfile

A plugin to pull ORCID information into a PKP user profile
GNU General Public License v3.0
16 stars 51 forks source link

PHP Fatal error: Uncaught Error: Call to a member function getId() on null #227

Closed dkikan closed 1 year ago

dkikan commented 1 year ago

Describe the bug At the site-wide level when public profile tab is clicked, nothing happens and in the error_log an error appears. There is no message at the front-end that this function will work only within a journal context and not site-wide.

To Reproduce Steps to reproduce the behavior:

  1. login as administrator
  2. Go to 'edit profile' under user context
  3. Click on 'public' tab under profile section
  4. nothing happens / it does not open public tab
  5. See error in the error_log file and no error / feedback on the front-end

Expected behavior Feedback to the user regarding the context issue or the tab should open with out ORCID button and with a clear message that ORCID is available only within the context of a journal and not site-wide.

Screenshots not required

Desktop (please complete the following information):

hope this gets fixed soon.

asmecher commented 1 year ago

@dkikan, please include the full error message from the error log (including line numbers and stack trace).

dkikan commented 1 year ago

Sure. here it is:

[01-Jan-2023 17:58:51 Asia/Kolkata] PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /home/zitco/public_html/interjournals.org/ojs/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php:358 Stack trace:

0 /home/zitco/public_html/interjournals.org/ojs/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php(437): OrcidProfilePlugin->buildOAuthUrl('orcidAuthorize', Array)

1 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/classes/plugins/HookRegistry.inc.php(107): OrcidProfilePlugin->handleUserPublicProfileDisplay('User::PublicPro...', Array)

2 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/classes/template/PKPTemplateManager.inc.php(1518): HookRegistry::call('User::PublicPro...', Array)

3 /home/zitco/public_html/interjournals.org/ojs/cache/t_compile/7e6d5f05733acad6cb8f0b00f668ce85c085916b^3421955854dbc3db10a9b61434d943a03ec7702c_0.app.userpublicProfileForm.tpl.php(161): PKPTemplateManager->smartyCallHook(Array, Object(Smarty_Internal_Template))

4 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_63b17c839d5657_37971882(Object(Smarty_Internal_Template))

5 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))

6 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))

7 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 0)

8 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, '7e6d5f05733acad...', NULL, 0)

9 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/classes/template/PKPTemplateManager.inc.php(1072): Smarty_Internal_TemplateBase->fetch('user/publicProf...', NULL, '7e6d5f05733acad...', NULL)

10 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/classes/form/Form.inc.php(197): PKPTemplateManager->fetch('user/publicProf...')

11 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/classes/user/form/PublicProfileForm.inc.php(131): Form->fetch(Object(Request), NULL, false)

12 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/controllers/tab/user/ProfileTabHandler.inc.php(156): PublicProfileForm->fetch(Object(Request))

13 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/classes/core/PKPRouter.inc.php(395): ProfileTabHandler->publicProfile(Array, Object(Request))

14 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)

15 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route(Object(Request))

16 /home/zitco/public_html/interjournals.org/ojs/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))

17 /home/zitco/public_html/interjournals.org/ojs/index.php(67): PKPApplication->execute()

18 {main}

thrown in /home/zitco/public_html/interjournals.org/ojs/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php on line 358

asmecher commented 1 year ago

@dkikan, this is the issue described here: https://forum.pkp.sfu.ca/t/orcid-plugin-error/74007

dkikan commented 1 year ago

@dkikan, this is the issue described here: https://forum.pkp.sfu.ca/t/orcid-plugin-error/74007

Thanks for your response, however, the link that you have shared just mentions to disable it in the index page and that it has been fixed in the newer versions. now 1. how to disable it in the index page is not detailed and 2. I am using 3.3.0.13 which is the latest and the issue is not fixed. Hope you take these into consideration and provide a little bit more details if possible. Thanks again.

asmecher commented 1 year ago

@dkikan, the forum is the best place to get support; I'd suggest continuing over there.

dkikan commented 1 year ago

The resolution provided in the forum is available at this link: https://forum.pkp.sfu.ca/t/orcid-plugin-error/74007/5?u=deepak.kikan (response added to make the solution available to anyone facing the same problem.