Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When using biblio_citeproc to format citations, the labels "eds." and "trans." are not appearing in the citation when author category is set to "Secondary" or "Tertiary", respectively.
Citation should appear like this:
Archard, David, and Colin MacLeod, eds. The Moral And Political Status Of Children, 2002.
Instead, it appears like this:
Archard, David , and Colin MacLeod. The Moral And Political Status Of Children, 2002.
This regression appears to have been introduced sometime between 7.x-1.0-rc4 and 7.x-1.0-rc5, at commit 2e83133 if "git bisect" is to be believed.
Configuration details:
- I am using a View with the "Chicago Manual of Style (full note)" citation style (although this behavior persists in other output styles)
- Drupal 7.34
- Biblio 7.x-1.x-dev (c584ee176382cef628e811ea0dd51a95e84a4527 commit)
Comment | File | Size | Author |
---|---|---|---|
#12 | biblio-2423083-authorlabels-12.patch | 3.71 KB | rjerome |
#8 | biblio-2423083-authorlabels-8.patch | 4.12 KB | sherakama |
#6 | biblio-2423083-authorlabels-6.patch | 1.76 KB | John Bickar |
#5 | biblio-2423083-authorlabels-5.patch | 1.74 KB | sherakama |
#3 | biblio-2423083-authorlabels-3.patch | 748 bytes | sherakama |
Comments
Comment #1
John Bickar CreditAttribution: John Bickar commentedComment #2
John Bickar CreditAttribution: John Bickar commentedComment #3
sherakama CreditAttribution: sherakama commentedAttached is a patch for reversing the commit that caused the labels to go away.
The commits that caused the labels to go away were trying to prevent all labels from showing unless there was a value assigned to the field. The labels continue to be hidden on fields with no values even after reverting the commits that caused the breakage.
It came down to this code. Lines 1184 - 1189 in CSL.inc
The check for the $field on $data always fails because $data is an array with multiple items. eg $data[0] = (object); $data[1] = (object);
I went back to rc4 as that was the last previous version that worked without additional patches to see what was in the $data and $field values. It is consistent with the latest release of rc7.
Do we need to keep this check?
Comment #4
sherakama CreditAttribution: sherakama commentedComment #5
sherakama CreditAttribution: sherakama commentedNew patch attached for latest dev.
Simplifying the label render function and plural evaluation.
Comment #6
John Bickar CreditAttribution: John Bickar commentedLet's try this one, for better to check plurality.
Comment #7
rjerome CreditAttribution: rjerome commentedBoth patches 5 & 6 are removing CSL functionality. The code is not obvious, but there are two "plural" variables. $this->plural is referring to the plural attribute in the cs:label element of the CSL spec... http://citationstyles.org/downloads/specification.html#label
Comment #8
sherakama CreditAttribution: sherakama commentedThanks for the speedy feedback. Attached is another try at simplifying the pluralization check.
Comment #9
John Bickar CreditAttribution: John Bickar commentedThe patch in #8 results in the citation not outputting "eds." or "trans." (same symptom as the original issue).
Comment #10
rjerome CreditAttribution: rjerome commentedOK, so I've tracked down and fixed (I think) this issue. Just need to do a little more testing to make sure the fix didn't break anything else.
Comment #11
rjerome CreditAttribution: rjerome commentedComment #12
rjerome CreditAttribution: rjerome commentedWould anyone care to test the attached patch. I believe it resolves the original issue.
Comment #14
rjerome CreditAttribution: rjerome commentedComment #15
sherakama CreditAttribution: sherakama commentedThank you.
Comment #16
John Bickar CreditAttribution: John Bickar commentedYes, looks great. Thanks!