Problem/Motivation

When importing a reference in the EndNote X3 XML format, contributors that already exist are created again. It seems the contributor deduplication setting has no effect.

Steps to reproduce

Import a reference in the EndNote X3 XML format with contributors that already exist.

Presumed root cause

As hypothesized in the comments below, the change to getDrupalDenormalizer in #3428258: Automated Drupal 11 compatibility fixes for bibcite broke the contributor deduplication using bibtex import:

-        $author = $this->serializer->denormalize(['name' => [['value' => $contributor['name']]]], Contributor::class, $format, $context);
+       $author = $this->getDrupalDenormalizer(['name' => [['value' => $contributor['name']]]], Contributor::class, $format, $context);

Issue fork bibcite-3537134

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gkaas created an issue. See original summary.

gkaas’s picture

Title: Contributor deduplication » Contributor deduplication setting has no effect
corn696’s picture

Hi i encountered the issue too, using bibtex import. Tested on a D10 Site

Seems the change to getDrupalDenormalizer in Automated Drupal 11 compatibility fixes for bibcite breaks the contributor deduplication using bibtex import.

corn696’s picture

mark_fullmer’s picture

Issue summary: View changes

mark_fullmer’s picture

Status: Active » Needs review

Thanks for reporting this. The root cause has to do with a change in Symfony from version 6 to 7, where Normalizers expect a getSupportedTypes() method to be present which specifies what things the given normalizer is eligible to normalize. It defaults to *, so what was happening was that the ReferenceNormalizer was being considered eligible for denormalization when Bibcite was trying to denormalize Contributor entities. The merge request resolves this issue; I need to double-check that this doesn't introduce backwards compatibility issues for earlier versions of Drupal...

mark_fullmer’s picture

Assigned: Unassigned » mark_fullmer
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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