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)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

John Bickar’s picture

Issue summary: View changes
John Bickar’s picture

Issue summary: View changes
sherakama’s picture

Attached 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

      $field = $this->citeproc->map_field($variable);

      if ((isset($data->$field) && !empty($data->$field)) && ($term = $this->citeproc->get_locale('term', $variable, $form, $plural))) {
        $text = $term;
        break;
      }

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?

sherakama’s picture

Status: Active » Needs review
sherakama’s picture

New patch attached for latest dev.

Simplifying the label render function and plural evaluation.

John Bickar’s picture

Let's try this one, for better to check plurality.

rjerome’s picture

Both 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

sherakama’s picture

Thanks for the speedy feedback. Attached is another try at simplifying the pluralization check.

John Bickar’s picture

Status: Needs review » Needs work

The patch in #8 results in the citation not outputting "eds." or "trans." (same symptom as the original issue).

rjerome’s picture

OK, 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.

rjerome’s picture

rjerome’s picture

Would anyone care to test the attached patch. I believe it resolves the original issue.

  • rjerome committed 7ca912f on 7.x-1.x
    Issue #2423083 by rjerome: CiteProc is not outputting editor nor...
rjerome’s picture

Status: Needs work » Fixed
sherakama’s picture

Thank you.

John Bickar’s picture

Yes, looks great. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.