For some reason, the biblio_calculate_contributor_hash function in biblio.contributors.inc does not include an author suffix in its calculation of the hash figure. This means that it is possible (though very unlikely) for two different authors to be misidentified as the same, and then to have their entries merged together during import. In our case, while trying to troubleshoot an issue with author suffix parsing during import, we found that authors who had been parsed differently were still being assigned to the same contributor, and the new (fixed) parsing of the suffix was being ignored.

Unless there is a performance issue or other reason, I would recommend adding the suffix field to the list of fields that create the hash value used to check different contributors.

Here is a section of the current biblio_calculate_contributor_hash from biblio.contributors.inc in 6.x-2.0.rc2, lines 592-599:

  $firstname = isset($creator['firstname']) ? $creator['firstname'] : '';
  $initials = isset($creator['initials']) ? $creator['initials'] : '';
  $prefix = isset($creator['prefix']) ? $creator['prefix'] : '';
  $lastname = isset($creator['lastname']) ? $creator['lastname'] : '';



  $string = $firstname . $initials . $prefix . $lastname;

And here is the code with the suffix added:

  $firstname = isset($creator['firstname']) ? $creator['firstname'] : '';
  $initials = isset($creator['initials']) ? $creator['initials'] : '';
  $prefix = isset($creator['prefix']) ? $creator['prefix'] : '';
  $lastname = isset($creator['lastname']) ? $creator['lastname'] : '';
  // added suffix, to preserve different versions of suffix formatting with same author
  $suffix = isset($creator['suffix']) ? $creator['suffix'] : '';

  // added suffix to string
  $string = $firstname . $initials . $prefix . $lastname . $suffix;

I guess this change might need to be accompanied by some action that would force a recalculation of all contributor hashes, but I don't have any idea it that might cause any other issues. In our case, we were re-importing our entire database, so the recalculation was done for everything anyways.

Phil.

Comments

liam morland’s picture

Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.