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
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
Comment #4
lolgm commentedThe 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:
Comment #6
mark_fullmerThanks, 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...
Comment #7
mark_fullmerI 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!
Comment #9
lolgm commented@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?
Comment #10
mark_fullmerThanks for the reminder! Credit given where credit is due :)
Comment #11
lolgm commented@mark_fullmer Thanks! :)