seboettg / citeproc-php

Full-featured CSL 1.0.1 processor for PHP
MIT License
75 stars 39 forks source link

issue with author #77

Closed asharmapu92 closed 4 years ago

asharmapu92 commented 4 years ago

Please follow the general troubleshooting steps first:

Bug reports:

Please replace this line with a brief summary of your issue

Used CSL stylesheet:

Please replace this line with the name of your used CSL stylesheet (i.e. chicago-author-date-16th-edition.csl)

Used CSL metadata

Please replace these lines with your used metadata, for instance:

[
    {
        "author": [
            {
                "family": "Anderson", 
                "given": "John"
            }, 
            {
                "family": "Brown", 
                "given": "John"
            }
        ], 
        "id": "ITEM-2", 
        "type": "book",
        "title": "Two authors writing a book"
    }
]
asharmapu92 commented 4 years ago

I am working with orcid work api with this library. I have issue with author name, because orcid work json data has three key for contain author name family, given and literal. So i added and one condition in name.php file under the Seboettg/CiteProc/Rendering/Name on line 224 then issue would be resolved. I have request to developer please add this code in your master branch code

////////////////////////////////////////////////// if (isset($name->family)) { $nameObj->family = $name->family; }elseif (!isset($name->family) && !empty($name->literal)) { $nameObj->family = substr($name->literal,0, 30); }

seboettg commented 4 years ago

Hi @asharmapu92 feel free to submit a pull request with your changes! More information you will find on the github help pages: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests