Open ewhanson opened 7 months ago
I had the same problem but I think I solved it. I'm using the orcidProfile 3.3.0 with OJS 3.3.0.10. I have already checked on the most updated github versions of the plugin and the bug persists.
I found two problems:
My solution (version 3.3.0)
problem 1
file:
/orcidProfile/pages/OrcidHandler.inc.php
line 117 is:
$httpClient->request(
but it must be:
$response = $httpClient->request(
(since the variable is not reassigned, it retains the previously loaded Json array)
problem 2
file /orcidProfile/pages/OrcidHandler.inc.php
line 140 is:
opener.document.getElementById("affiliation").value = ' . json_encode(@$employmentJson['employment-summary'][0]['organization']['name']) . ';
but it must be:
opener.document.getElementById("affiliation").value = ' . json_encode(@$employmentJson['affiliation-group'][0]['summaries'][0]['employment-summary']['organization']['name']) . ';
(to extract data from the working architecture)
I made these two corrections and it works for me, if needed I can do the pull-request.
I found the same problems on version 3.4.0 but the file involved is: /orcidProfile/OrcidProfileHandler.php line 148 and line 173
I hope I was helpful.
Abramo
Thanks @Nostrabramus for confirming this! I've confirmed and addressed this in the big refactor the ORCID plugin just went through (on the main
branch), but will get this changed ported back to OJS 3.3 and 3.4.
Describe the bug When the
orcidAuthorize
handler method is run, the public API is called to fetch information about the authenticated ORCID user, including any employment information.The affiliation field on the OJS registration form is supposed to be filled with the following information from an associative array returned from the
/employments
ORCID endpoint$employmentJson['employment-summary'][0]['organization']['name']
, but the key ofemployment-summary
is not included.See PHP generated warning:
To confirm:
/employments
endpoint change and does the corresponding OJS code need to be updated?Additional context Observed in OJS 3.4, but likely an issue in previous versions.