-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert array to string before cleaning up value. (#184) #185
base: master
Are you sure you want to change the base?
Conversation
This is a quick fix assuming the supplied value is an array of strings. Please kindly review.
Sorry about the mistake! This should do the work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please consider my comment.
Fix fatal error when encountering non-numeric "page" values
Conposer.json fix
@seboettg Thanks again for your reply. Having a closer look, it seems the problematic item is "Copyright", which is an array containing one (or potentially more) objects, as indicated below. I wonder whether we can look at the upstream and check how this complex array/object ends up here inside At the moment, I added a test case, and hardcoded a fix specific for the license field, i.e. just extracting the URL from the license. I don't think it's an ideal fix at all, and your feedback would be appreciated. Maybe, we could even ignore the license field as Bibtex does not enforce it. "license": [
{
"URL": "https://creativecommons.org/licenses/by/4.0/",
"content-version": "vor",
"delay-in-days": 0,
"start": {
"date-parts": [
[
2023,
11,
8
]
],
"date-time": "2023-11-08T00:00:00Z",
"timestamp": 1699401600000
}
}
], |
Perhaps, it's worth checking for a license field like below, inside the render() function, and add the string extraction logic to a new function elseif ($this->toRenderTypeValue === "license") {
$renderedText = $this->renderLicense($data->{$this->toRenderTypeValue});
break;
} After implementing the above, I found the ISSN field in this example is still causing complaints, as it is an array containing a string, like ["2071-1050"], breaking For your reference, the JSON is retrieved from DOI content negotiation. I wonder why it returns data in non-compliant format... curl -LH "Accept: application/vnd.citationstyles.csl+json, application/rdf+xml" https://doi.org/10.3390/su152215733 |
This is a quick fix assuming the supplied value is an array of strings.
I had to apply this patch for my application to work.
Please kindly review. Suggestions much appreciated!
Ref: #184