Closed steinmb closed 3 years ago
I'd perhaps go for both, to prevent errors:
ELMCIP have its own custom Digital Object Identifier
field formatter. Time revisit that code I think.
Confirm this is a bug. Have to retest the DOI field formatter. It even check to make sure the DOI string only contain the number. Viewing the node it render the DOI code with the URL hardcoded. Well, it is suppose to do that. Good catch.
Strike that. We only have a custom validator for DOI, ORCID get no special treatment and by doing so we allow both full URL and numeric values to be used. I think that was why we decided to treat DOI with a custom formatter.
Re-tested field. For ORCID we use the Link module. I would claim that the URL validation it provide is not working as expected, allowing this mix to me added.
We might have to roll our own custom code for this.
OK, thx @steinmb so should we correct the text description to tell users they should insert only the full ORCID URL (to avoid the link error)?
We should, but one other hand, we cannot trust the user to do the right thing here. In theory the Link module should have validated the data entered and rejected non URL text, but it does not.
I have pondered a bit on this. In https://github.com/elmcip/elmcip/commit/2885d07e5d295291cee9cf6294fb175a27cbf507 is there some work in progress.
I see. Line 35 seems to be the golden coin: return l($url, 'https://orcid.org/' . $url); Let me know when you need testing
Pushed the following changes to test.elmcip.net - Needs to be tested though:
commit b6cc2124d7b94969e00f6ade4c7acbfa64138bb2 (HEAD -> master, origin/master, origin/HEAD) Author: Stein Magne Bjorklund steinmb@smbjorklund.com Date: Wed Jun 9 15:20:55 2021 +0200
Issue 467 Improve ORCID validation and render
Valid data is: full URL or the ORCID id.
commit cc4797c9f27b20409170725d94925330934391e9 (HEAD -> master, origin/master, origin/HEAD) Author: Stein Magne Bjorklund steinmb@smbjorklund.com Date: Wed Jun 9 17:53:28 2021 +0200
Issue 467 Update link settings with custom formatter and validator.
Great, it works in both instances: ID code insertion and full URL
@AlvaroSeica wrote:
?See image below (https://elmcip.net/node/10200/edit)
Originally posted by @AlvaroSeica in https://github.com/elmcip/elmcip/issues/374#issuecomment-849638648