Closed artbovboosta closed 5 years ago
Object $data contains different data before and after $citeProc->render($data, "bibliography"); operation.
$data
$citeProc->render($data, "bibliography");
Full code:
$data = file_get_contents("metadata_test.json"); $data = json_decode($data); echo '<pre>'; print_r($data); echo '</pre>'; $style = StyleSheet::loadStyleSheet('apa'); $citeProc = new CiteProc($style); echo $citeProc->render($data, "bibliography"); echo '<pre>'; print_r($data); echo '</pre>';
The result is:
In class Text.php, on line 106, there is "unset" operation which removes title field.
title
As objects are passed by references by default, I suggest to clone those objects before processing.
P.S. I noticed that this issue occurs only when "type": "webpage" and there is no authors.
"type": "webpage"
apa
[ { "URL": "www.starwars.com/", "accessed": { "date-parts": [ [ "2018", "09", "19" ] ] }, "id": "item-1", "title": "StarWars.com | The Official Star Wars Website", "type": "webpage" } ]
Thank you for this bug report. Version 2.1.5 has been released which should solve this bug. Please close this issue if everything works properly.
Everything works fine. Thanks a lot!
Please follow the general troubleshooting steps first:
Bug reports:
Object
$data
contains different data before and after$citeProc->render($data, "bibliography");
operation.Full code:
The result is:![image](https://user-images.githubusercontent.com/37540289/45750895-270a7080-bc19-11e8-8466-2eb264c76105.png)
In class Text.php, on line 106, there is "unset" operation which removes
title
field.As objects are passed by references by default, I suggest to clone those objects before processing.
P.S. I noticed that this issue occurs only when
"type": "webpage"
and there is no authors.Used CSL stylesheet:
apa
Used CSL metadata
[ { "URL": "www.starwars.com/", "accessed": { "date-parts": [ [ "2018", "09", "19" ] ] }, "id": "item-1", "title": "StarWars.com | The Official Star Wars Website", "type": "webpage" } ]