Problem/Motivation

When importing a BibTeX file, existing keywords or keywords repeated in the source file are recreated instead of being reused.
It seems that the keyword deduplication setting has no effect during the import.

Steps to reproduce

Import a BibTeX file that contains keywords which already exist in the system and/or keywords that are repeated within the file itself.

Proposed resolution

Issue #3537134: Contributor deduplication setting has no effect addressed a similar problem for Contributors. I believe the same approach could be applied here to ensure that keywords are not duplicated during the import.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork bibcite-3566108

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

lolgm created an issue. See original summary.

lolgm’s picture

Status: Active » Needs review

The MR !50 provides a proposed resolution for the reported issue, but it is currently failing in the automated tests.
From what I was able to analyze, the failure does not seem to be related to the proposed change.

To validate this, I ran the tests locally against previous versions of the module:

Drupal 10.6.1 — PHP 8.3.27
Module 3.0.1 and 3.0.0
Both passed the tests (only with deprecation notices).

Drupal 11.3.1 — PHP 8.3.27
Module 3.0.1 and 3.0.0
Both failed the tests with the same error observed in the MR !50 pipeline.

Based on this, I created MR !51 with the same proposed resolution as MR !50, plus an additional proposal to fix the automated tests.
I don’t have much experience with Drupal Kernel tests, so I can’t guarantee this is the ideal approach.
However, the proposal follows the same pattern used in some core tests:

mark_fullmer made their first commit to this issue’s fork.

mark_fullmer’s picture

The MR !50 provides a proposed resolution for the reported issue, but it is currently failing in the automated tests.
From what I was able to analyze, the failure does not seem to be related to the proposed change.

Thanks, yes, this was a problem in the module that was unrelated to the proposed change here, and was resolved in #3537134: Contributor deduplication setting has no effect. I've merged the latest changes from 3.0.x so we can see if tests pass on MR !50 now...

mark_fullmer’s picture

Status: Needs review » Fixed

I used XDebug to dig into what was being populated from the denormalizer, before and after, and the code change proposed yields the correct "discovery" of existing keywords. I also functionally tested the keyword deduplication and was able to confirm that this fixes the issue!

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.

lolgm’s picture

@mark_fullmer Thank you for reviewing and testing this issue.

If you consider that the information and code I provided contributed to resolving this problem, would it be possible to attribute credit to me?

mark_fullmer’s picture

If you consider that the information and code I provided contributed to resolving this problem, would it be possible to attribute credit to me?

Thanks for the reminder! Credit given where credit is due :)

lolgm’s picture

@mark_fullmer Thanks! :)

Status: Fixed » Closed (fixed)

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