[ojs] ORCID 400 Bad request: invalid JSON

Hola, estoy usando ORCID para empujar el registro de los artículos, pero cuando el articulo lo publico, en el log del orcid tengo este error:
ERROR Unexpected status 400 response, body: {"response-code":400,"developer-message":"400 Bad request: invalid JSON - cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[\\s\\S]*[^\\s\\n\\r]+[\\s\\S]*' for type '#AnonType_translated-title'.","user-message":"Invalid JSON.","error-code":9047,"more-info":"https://members.orcid.org/api/resources/troubleshooting"}

Estoy dando vueltas y no encuentro la solución. Uso Php 7.3.18

(Also posted as a github issue: 400 Bad request: invalid JSON · Issue #131 · pkp/orcidProfile · GitHub)

@dagosalasCaution about DOIs and Brackets - ORCID Community

Creo que el problema son los valores NULL que no son aceptados:


Y esto viene del siguiente código:

¿Alguna idea?

Quizás de prueba, se podría modificar la línea

'value' => $publication->getLocalizedData('en_US'),


'value' => $publication->getLocalizedData('es_ES'),

Modificando es_ES por el código de tu primer idioma, es_MX?

Sería un valor duplicado, pero por probar si viene de ahí el problema.
Si es así y no es una revista multilenguaje, supongo que se puede quitar de la construcción del JSON, la clave/valor translated-title.

Si, fue lo primero que hice, e igual me manda valor NULL, también la hice totalmente Inglés y sigue dando valor NULL. Igual si revisas el json tampoco trae el nombre del journal. Quizás ese método no es correcto para obtener ese valor.

Hi @dagosalas
I have made a commit to attempt the issue you are facing.
There were two reasons for the error in this case.

Plugin Bugs

  • There were null elements in the json object, which were rejected by API.
  • English language was set as default in a hard coded fasion.

I have sent a fix to that problem in to the master branch of the orcidProfile.

I have tested the functionalities locally with two languages (en_US, ca_ES). But I want to confirm it before releasing the plugin.

Can you please test this fix ?

If you are not a coder, here are the instructions to install it.

cd $MY_OJS_INSTALLATION/plugins/generic
rm -rf orcidProfile
git clone https://github.com/pkp/orcidProfile.git


Hi @Dulip_Withanage, I opened this and @dagosalas suggested your fix can solve our problem.
We are using OJS 3.1.2-4, so we updated the plugin to 1.1.1-3: is your fix present in this version or not?
Best regards

The newest Version ist

1 Like

Hi @Dulip_Withanage, thank you very much.
Does this version fix both bugs you mentioned here?
I think we are currently affected by both of them.
Best regards

Hi @bolelligallevi,
Yes. It shuld fix both issues. Please be free to update and let me know

Hi @Dulip_Withanage, the newest version solved our problems, thank you very much again.
I updated the italian locale (both xml files), how can I share them for including in the release?
Best regards,

We are having problems with the Orcid Plugin, authors are no longer able to authenticate their records in our journal, they receive the error message: “OJS was unable to communicate with the ORCID service. Please contact the journal manager indicating your name, ORCID iD, and details of your submission.”
can anybody help me?

1 Like

I am having the same problem using OJS It was working three weeks ago.
Any ideas? can anybody help?,

Hi @dlizcano,

You’re probably encountering this issue:

It appears to be related to a server-side change at ORCiD; we’re talking with them to see if they can revert it. Meanwhile the linked issue has a work-around.

Alec Smecher
Public Knowledge Project Team

1 Like