Open diegodlh opened 2 years ago
If we resolve #156 by requiring a source item in the constructor of a citation, I think this issue is easier to solve? But this isn't the only solution. Let me know what you think.
I have just added some comments to #156: I think we could avoid using the Citation constructor directly, and using a source item's addCitation
method instead.
My proposal above (having the source item's addCitations
method update the source item relationships) was wrong, because whereas it does cover (1) the case where a zotero
key is given to new Citation()
(without using the citation's linkToZoteroItem
), it doesn't cover (2) the (unlikely) case where a zotero
key is manually added to the note attachment (because addCitations
is not called by loadCitations
).
Provided you agree with my comments in #156, for (1) we could just use the citation's linkToZoteroItem
method if a zotero
key was provided to the addCitation
method proposed in #156.
For (2), inside the source item's loadCitations
method we could make sure that all cited items with a zotero
key are already marked as related to the source/citing item. Otherwise, write pending relationships altogether. Beware this may conflict with #18.
I think we could solve (1) for now, and leave (2) for later (and change the issue's title accordingly).
As described here, there may be cases where a Citation is linked to a Zotero item without using the Citation's
linkToZoteroItem
method. In these cases, the citing and cited items may not be marked as related in Zotero. To fix this change theSourceItemWrapper
'saddCitations
method to: