Skip to content

Fix author and editor name export in MODS format - #17936

Merged
Siedlerchr merged 16 commits into
JabRef:mainfrom
USC-dot:fix/mods-author-editor-export-17898
Nov 29, 2026
Merged

Siedlerchr merged 16 commits into
JabRef:mainfrom
USC-dot:fix/mods-author-editor-export-17898

Conversation

@USC-dot

@USC-dot USC-dot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

MODS export was mangling author names that contained "and", since it split them manually on the string. I swapped that out for AuthorList.parse(), which JabRef already has. While I was in there, I also added editors to the export and used the MARC role codes (aut / edt) so the roles come out right in the XML. Added regression tests, including the case from #17898.

Steps to test

  1. Open JabRef. Use the fixed build, or the old one if you want to see the bug first.
  2. Import the BibTeX example from issue MODS export corrupts names fields #17898.
  3. Click the Doe2026 entry.
  4. Export it as MODS.
  5. Open the XML file in any text editor.
  6. Look at the names. You should see three authors and one editor, all intact.
mods-input mods-export-result (2)

Related issues and pull requests

Closes #17898

AI usage

Tool: ChatGPT (GPT-6.2)

AI assistance included generating implementation code, regression
tests, troubleshooting build errors,reviewing code and documentation assistance.

AI Influence Level: AIL4 (provisional assessment).

AI CHECKLIST.md walkthrough

Code checklist

1. Code self-review

Nullability and control flow

  • No == null / != null checks — JSpecify annotations (@NullMarked, @Nullable, @NonNull) used instead.
  • No Objects.requireNonNull(...) — nullability expressed via JSpecify annotations.
  • [/] New classes annotated with @NullMarked (org.jspecify.annotations.NullMarked).
  • [/] New packages annotated with @NullMarked (org.jspecify.annotations.NullMarked).
  • Optional consumed with ifPresent / ifPresentOrElse / map / orElseThrow — never orElse(unusedValue) nor an isPresent() + get() block.
  • [/] StringUtil.isBlank(...) used instead of s == null || s.isBlank().

Exceptions

  • No catch (Exception e) — only specific exceptions are caught.
  • No throw new RuntimeException(...) / IllegalStateException(...) — these tear down the whole application.
  • [/] Logged exceptions are passed as the last logger argument (LOGGER.info("...", e)), not concatenated into the message string.

Style and idioms

  • New BibEntry objects built with withers (withField, not setField).
  • Modern Java used: List.of() / Map.of() / Set.of(), Path.of(), SequencedCollection / SequencedSet, text blocks.
  • Regexes use a precompiled Pattern.compile(...) constant, not String.matches(...).
  • Keep alphabetical ordering when adding variables or enum items.
  • [/] Background work uses org.jabref.logic.util.BackgroundTask, not new Thread().
  • No commented-out code, no trivial comments restating the code, no AI-disclosure comments in source.
  • [/] Markdown Javadoc (///) uses Markdown syntax, not JavaDoc inline tags: `code` instead of {@code}, [ClassName] instead of {@link}.

User-facing text

  • [/] All user-facing text localized (Localization.lang in Java, % prefix in FXML).
  • [/] Sentence case (not Title Case); no trailing !; labels do not end with :.
  • [/] Variance expressed with placeholders ("...: %0"), not string concatenation.

Security

  • [/] User-controlled data (request params, entry fields, file contents) is HTML-escaped before being written into any text/html response — including exception/error messages, not just the success body (XSS).

Tests

  • In case issue lists an example, this concrete example is covered by a test case.
  • Behavior changes in org.jabref.model / org.jabref.logic have added or updated tests.
  • Tests assert object contents (assertEquals), use plain JUnit asserts (not AssertJ), have no @DisplayName, do not catch exceptions (let them propagate so JUnit reports setup/teardown failures directly), and use @TempDir instead of manual temp directories.
  • [/] Fetcher tests hit the live endpoints — the remote API is not mocked or stubbed (automated-review suggestions to mock it are rejected on purpose).

2. Verification commands

Run in this order — cheapest first. Each must pass.

  • ./gradlew :jablib:check (or ./gradlew check for all modules).
  • ./gradlew checkstyleMain checkstyleTest checkstyleJmh.
  • ./gradlew modernizer.
  • ./gradlew --no-configuration-cache :rewriteDryRun reports no changes (run ./gradlew rewriteRun to fix).
  • ./gradlew javadoc.
  • npx markdownlint-cli2 "docs/**/*.md" "*.md" (only if Markdown changed).
  • npm ci && npm run textlint reports no misspellings (only if Markdown changed).
  • [/] Only if formatting is still off after rewriteRun: docker run -v $(pwd):/github/workspace ghcr.io/leventebajczi/intellij-format:master "*.java" "" ".idea/codeStyles/Project.xml".

Verification observations

  • Targeted MODS regression tests passed.
  • Manual MODS export testing passed.
  • Requirements tracing passed with zero defects.
  • The full test suite did not complete successfully.
  • The preferences test failure was reproduced on the unchanged baseline.
  • The OAuth test passed when rerun individually.
  • OpenRewrite completed without suggesting changes.
  • OpenRewrite recipe validation and source parsing errors were reproduced on the unchanged baseline.
  • Checkstyle passed across the modules before the final changes. The jablib Checkstyle tasks were rerun successfully after the final changes.

3. Documentation

  • CHANGELOG.md entry added if the change is visible to the user (end-user wording, no extra blank lines, sorted in next to existing entries about the same component/feature). Link the issue if one exists; link the PR only when no issue exists. Use TODO as the placeholder when neither is known yet — never a fake number. No entry for fixes to changes that were themselves introduced after the last release (feature only in ## [Unreleased]) — update the existing unreleased entry instead if needed.
  • Searched jabref/issues and jabref-koppor/issues for a related issue; linked only on a confident match, otherwise kept TODO (no closes/fixes for merely-similar issues).
  • Requirement added to docs/requirements/<area>.md if the change is a new feature or significant bug fix (skip for refactors, minor fixes, and internal changes).
  • Developer documentation under docs/ updated if behavior or architecture changed.

4. Pull request

  • PR body built from .github/PULL_REQUEST_TEMPLATE.md, every section filled.
  • All checklist items kept and marked [x], [ ], or [/].
  • "Steps to test" is a numbered list with a cropped screenshot of the result for every visible change; no video (only allowed when another program is involved, e.g. drag and drop or push to an external application).
  • All HTML comments removed from the PR body.
  • PR created with gh pr create --body-file <file> (not --body).
  • [/] If CHANGELOG.md used a TODO placeholder (no issue confidently identified yet — an existing issue link always stays), the PR was opened as draft, the placeholder was replaced with the real PR-number link after PR creation, committed and pushed, and only then was the PR marked ready for review. If an issue is identified or created later, the link is switched to the issue.

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • If AI tools were used, I disclosed them in the "AI usage" section and reviewed, understood, and take full ownership of all AI-generated code
  • I manually tested my changes in running JabRef (always required)
  • I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • I added one sentence (max 20 words) to CHANGELOG.md describing the change from the user's point of view (if the change is visible to the user)
  • I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@jabref-machine jabref-machine added the dev: send-to-black-forest Port to the black-forest branch of JabRef/jabref-black-forest after merging (ADR-0073) label Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hey @USC-dot! 👋

Thank you for contributing to JabRef!

We have automated checks in place, based on which you will soon get feedback if any of them are failing. We also use Qodo for review assistance. It will update your pull request description with a review help and offer suggestions to improve the pull request.

After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. You can read about the whole pull request process in our contribution guide.

Please ensure that your pull request is in line with our AI Usage Policy and make necessary disclosures.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Preserve author names and export editors in MODS

🐞 Bug fix ✨ Enhancement 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Use JabRef’s author parser to prevent incorrect name splitting in MODS exports.
• Export editors and identify authors and editors with MARC role codes.
• Add regression tests, update XML fixtures, and document the expected behavior.
Merge Risk 🟡 Medium

Blast radius 🟡 Medium 💥 2 capabilities

  • 2 affected capabilities within one bounded functional scope: bibliographic contributor name handling.
  • The exporter, importer, role mapping, and BibTeX contributor fields form one bounded MODS interoperability behavior.
  • The path crosses the MODS contract but does not establish unrelated capabilities.
  • This is a distinct user-visible operation within the same bounded contributor-name subsystem: it produces display and alphabetization representations rather than MODS interchange records.
Sources

jablib/src/main/java/org/jabref/logic/exporter/ModsExporter.java[396-410]

            String familyName = author.getNamePrefixAndFamilyNameForDisplay();
            String givenName = author.getGivenNameWithOriginalPunctuation()
                                     .or(() -> author.getExplicitGivenNameInitials().filter(initials -> !initials.isEmpty()))
                                     .orElse("");
            String suffix = author.getNameSuffix().orElse("");
            // https://www.loc.gov/standards/mods/userguide/name.html
            if (StringUtil.isInCurlyBrackets(familyName) && givenName.isEmpty() && suffix.isEmpty()) {
                writer.writeAttribute("type", "corporate");
                writeNamePart(writer, "", Author.FORMATTER.format(familyName));
            } else if (familyName.isEmpty() && givenName.isEmpty() && suffix.isEmpty()) {
                // A custom extended name may have no standard BibLaTeX name parts.
                writeNamePart(writer, "", author.getAsBibtex());
            } else {
                writer.writeAttribute("type", "personal");
                writePersonalNameParts(writer, familyName, givenName, suffix);

jablib/src/main/java/org/jabref/logic/exporter/ModsExporter.java[109-114]

                    if (PERSON_NAME_ROLES.containsKey(field)) {
                        // MARC asg denotes a printing or publishing license assignee.
                        String role = field == StandardField.ASSIGNEE && bibEntry.getType() == IEEETranEntryType.Patent
                                      ? "pth"
                                      : PERSON_NAME_ROLES.get(field);
                        handleNames(writer, value, role);
Behavioral complexity 🟡 Medium 🧩 Compatibility cases, Interacting branches

  • Before, MODS export handled authors with simple splitting and import collected names as authors.
  • After, role aliases, multiple contributor fields, corporate versus personal names, suffixes, legacy untyped names, unknown roles, and extended names interact.
  • New correctness conditions are preserving role identity across export/import, selecting the correct name-shape branch, and retaining legacy compatibility.
Sources

jablib/src/main/java/org/jabref/logic/exporter/ModsExporter.java[109-114]

                    if (PERSON_NAME_ROLES.containsKey(field)) {
                        // MARC asg denotes a printing or publishing license assignee.
                        String role = field == StandardField.ASSIGNEE && bibEntry.getType() == IEEETranEntryType.Patent
                                      ? "pth"
                                      : PERSON_NAME_ROLES.get(field);
                        handleNames(writer, value, role);

jablib/src/main/java/org/jabref/logic/exporter/ModsExporter.java[396-410]

            String familyName = author.getNamePrefixAndFamilyNameForDisplay();
            String givenName = author.getGivenNameWithOriginalPunctuation()
                                     .or(() -> author.getExplicitGivenNameInitials().filter(initials -> !initials.isEmpty()))
                                     .orElse("");
            String suffix = author.getNameSuffix().orElse("");
            // https://www.loc.gov/standards/mods/userguide/name.html
            if (StringUtil.isInCurlyBrackets(familyName) && givenName.isEmpty() && suffix.isEmpty()) {
                writer.writeAttribute("type", "corporate");
                writeNamePart(writer, "", Author.FORMATTER.format(familyName));
            } else if (familyName.isEmpty() && givenName.isEmpty() && suffix.isEmpty()) {
                // A custom extended name may have no standard BibLaTeX name parts.
                writeNamePart(writer, "", author.getAsBibtex());
            } else {
                writer.writeAttribute("type", "personal");
                writePersonalNameParts(writer, familyName, givenName, suffix);
Potential damage 🟡 Medium 🩹 Incorrect results

  • A regression could distort a contributor name or assign it to the wrong BibTeX role field.
  • Reverting prevents new conversion errors, but already exported or imported records require regeneration from correct source data or manual repair.
  • No automatic repair worker or retry path is present.
  • Existing incorrect files or records need a fresh conversion, source data, or manual correction.
Sources

jablib/src/main/java/org/jabref/logic/exporter/ModsExporter.java[109-114]

                    if (PERSON_NAME_ROLES.containsKey(field)) {
                        // MARC asg denotes a printing or publishing license assignee.
                        String role = field == StandardField.ASSIGNEE && bibEntry.getType() == IEEETranEntryType.Patent
                                      ? "pth"
                                      : PERSON_NAME_ROLES.get(field);
                        handleNames(writer, value, role);

jablib/src/main/java/org/jabref/logic/exporter/ModsExporter.java[396-410]

            String familyName = author.getNamePrefixAndFamilyNameForDisplay();
            String givenName = author.getGivenNameWithOriginalPunctuation()
                                     .or(() -> author.getExplicitGivenNameInitials().filter(initials -> !initials.isEmpty()))
                                     .orElse("");
            String suffix = author.getNameSuffix().orElse("");
            // https://www.loc.gov/standards/mods/userguide/name.html
            if (StringUtil.isInCurlyBrackets(familyName) && givenName.isEmpty() && suffix.isEmpty()) {
                writer.writeAttribute("type", "corporate");
                writeNamePart(writer, "", Author.FORMATTER.format(familyName));
            } else if (familyName.isEmpty() && givenName.isEmpty() && suffix.isEmpty()) {
                // A custom extended name may have no standard BibLaTeX name parts.
                writeNamePart(writer, "", author.getAsBibtex());
            } else {
                writer.writeAttribute("type", "personal");
                writePersonalNameParts(writer, familyName, givenName, suffix);
Assessed commit f0db245
Diagram

graph TD
  A["BibEntry name fields"] --> B(["AuthorList parser"]) --> C(["MODS exporter"]) --> D["MODS name XML"]
Loading
High-Level Assessment

Reusing AuthorList.parse() is the best fit: it replaces fragile delimiter splitting with JabRef’s existing BibTeX name handling. Keeping MODS-specific role serialization in the exporter avoids introducing a separate parsing path or unnecessary abstraction.

Files changed (8) +171 / -33

Bug fix (1) +33 / -26
ModsExporter.javaParse and serialize author and editor names +33/-26

Parse and serialize author and editor names

• Replaces manual author splitting with AuthorList.parse() and uses one name-writing path for authors and editors. Writes parsed family and given parts plus 'aut' or 'edt' MARC role terms.

jablib/src/main/java/org/jabref/logic/exporter/ModsExporter.java

Tests (5) +126 / -7
ModsExportFormatTest.javaVerify exported names and MARC roles +83/-0

Verify exported names and MARC roles

• Adds parameterized XML assertions for author and editor names in given-first and family-first BibTeX forms. Checks name parts, ordering, and role-term attributes and values.

jablib/src/test/java/org/jabref/logic/exporter/ModsExportFormatTest.java

ModsExportFormatTestAllFields.xmlRefresh all-fields MODS expectation +7/-1

Refresh all-fields MODS expectation

• Adds author role terms and reflects trimmed family-name output from the shared parser.

jablib/src/test/resources/org/jabref/logic/exporter/ModsExportFormatTestAllFields.xml

ModsExportFormatTestMultipleEntries.xmlRefresh multiple-entry MODS expectations +22/-4

Refresh multiple-entry MODS expectations

• Adds author role terms to both exported records and removes leading spaces from parsed family names.

jablib/src/test/resources/org/jabref/logic/exporter/ModsExportFormatTestMultipleEntries.xml

ModsExportFormatTestOnlyRequiredFields.xmlRefresh required-fields MODS expectation +11/-2

Refresh required-fields MODS expectation

• Adds author role terms and updates family names to match parser output.

jablib/src/test/resources/org/jabref/logic/exporter/ModsExportFormatTestOnlyRequiredFields.xml

ModsExportFormatTestTotalPages.xmlAdd author role to total-pages fixture +3/-0

Add author role to total-pages fixture

• Adds the 'aut' MARC relator term to the expected personal name.

jablib/src/test/resources/org/jabref/logic/exporter/ModsExportFormatTestTotalPages.xml

Documentation (2) +12 / -0
CHANGELOG.mdAnnounce corrected MODS names and editor export +2/-0

Announce corrected MODS names and editor export

• Adds an unreleased fix entry linking issue #17898.

CHANGELOG.md

export.mdSpecify MODS name and role requirements +10/-0

Specify MODS name and role requirements

• Documents preservation of author and editor names and the required MARC relator codes. Links the requirement to the issue, implementation, and unit test.

docs/requirements/export.md

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (2)

Grey Divider


Remediation recommended

1. Editors with protected names split on import 🐞 Bug
Description
handleNames writes a protected personal-name component without its BibTeX braces, and
addPersonalName does not restore that protection when reconstructing the field. For an editor such
as {Rock and Roll}, Jane, exporting and re-importing produces Rock and Roll, Jane, which the
name parser reads as two people rather than one; other newly exported contributor fields follow the
same path.
Code

jablib/src/main/java/org/jabref/logic/exporter/ModsExporter.java[R396-399]

+            String familyName = author.getNamePrefixAndFamilyNameForDisplay();
+            String givenName = author.getGivenNameWithOriginalPunctuation()
+                                     .or(() -> author.getExplicitGivenNameInitials().filter(initials -> !initials.isEmpty()))
+                                     .orElse("");
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Exporting a protected `and` within a personal-name component removes its BibTeX braces. The MODS importer then reconstructs an unprotected contributor field that the name parser splits into multiple people.
## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/exporter/ModsExporter.java[391-410]
- jablib/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java[773-789]
## Recommended Fix
When rebuilding a BibTeX contributor name from MODS parts, protect component text that would otherwise be interpreted as a name-list separator. Add an export/import round-trip test for an editor with a protected `and` in a personal family or given name.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (1)
2. Contributor suffixes split on re-import 🐞 Bug
Description
addPersonalName inserts termsOfAddress into a comma-delimited BibTeX name without protecting
commas inside the suffix. For Doe, {Jr., Sr.}, John, MODS export retains the suffix as one name
part, but re-import produces Doe, Jr., Sr., John, which the name parser reads with a different
suffix and given name.
Code

jablib/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java[R785-788]

+        if (!termsOfAddress.isEmpty()) {
+            name.add(String.join(" ", termsOfAddress));
      }
+        name.add(givenName);
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Re-importing a MODS contributor whose suffix contains a literal comma changes the parsed suffix and given name because the importer writes that comma back as BibTeX syntax.
## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java[773-789]
- jablib/src/test/java/org/jabref/logic/exporter/ModsExportFormatTest.java[151-189]
## Recommended Fix
Protect literal commas in reconstructed BibTeX name parts before joining them with delimiter commas. Add an export/import regression test for `Doe, {Jr., Sr.}, John` that checks the parsed suffix and given name after re-import.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Resolved findings
1. Importing MODS silently drops contributors with other roles ✓ Resolved High
Description
parseName sets hasRoleTerm = true for any non-empty roleTerm, but it only adds a target field
when contributorField(role) recognises the role. A name whose roles are all unrecognised therefore
ends up with an empty contributorFields set and is discarded. MODS records from library catalogues
and other tools often use roles such as ctb/contributor, ths/thesis advisor, ill/illustrator,
cmp, or non-MARC text terms. The old importer kept all of these names as authors; now they vanish
from the imported entry without any warning.

2. Imported suffix becomes a first name ✓ Resolved Medium
Description
addPersonalName joins family, termsOfAddress and given names with ,  and leaves out the
given-name slot when it has no given names, so family=Smith + termsOfAddress=Jr. becomes `Smith,
Jr.. BibTeX reads a two-part Last, X` name as family plus given name, so a MODS name that has a
suffix but no given name is stored with Jr. as the person's first name, and the author list,
citation keys and formatted output all show the wrong name.

3. Given name field can be null without a @nullable annotation ✓ Resolved Medium

Resolving commit: f0db245

Resolution reason
Field givenName is now declared private final @Nullable String givenName; and
addDotIfAbbreviation is annotated @Nullable for both parameter and return, so the nullable value
flowing into givenName is now declared nullable, matching the sibling field.
Description
The changed constructor line assigns addDotIfAbbreviation(givenNameWithOriginalPunctuation) to
givenName, which is declared as a plain String with no @Nullable type-use annotation.
givenNameWithOriginalPunctuation is @Nullable, and addDotIfAbbreviation takes an unannotated
parameter and returns name unchanged when it is null, so the field can hold null for an author
with no given name. The annotated sibling field givenNameWithOriginalPunctuation was added in the
same change, which makes the unannotated givenName field the inconsistent one. Readers and
nullness checkers will treat givenName as non-null, so later code that dereferences it without a
check will not be flagged.

4. Given-only contributors disappear on import ✓ Resolved Medium
Description
handleNames exports given=Alice as a typed given-name part, but handleAuthorsInNamePart adds a
contributor only when it finds a family-name part. Re-importing that export leaves the corresponding
contributor field unset; a suffix-only extended name follows the same path.

5. Prefix-only names become family names ✓ Resolved Medium
Description
handleNames uses getNamePrefixAndFamilyNameForDisplay() as the MODS family part, even when an
extended name has a prefix but no family. For prefix=de, export writes de as a family name and
re-import stores de, losing the original prefix label.

6. Organization editors appear as people ✓ Resolved Medium
Description
handleNames labels every newly exported editor as type="personal" and writes a protected
organization name from getNamePrefixAndFamilyName() with its BibTeX braces intact. When an editor
field contains a corporate name such as {{World Health Organization}}, MODS consumers receive a
personal name with literal braces rather than an organization name.

7. Apostrophe-prefixed surnames gain spaces ✓ Resolved Medium
Description
handleNames uses getNamePrefixAndFamilyName(), which always inserts a space between the prefix
and family name. For an extended name such as prefix=d’, family=Antin, MODS exports d’ Antin
even though the name's supported display form is d’Antin.

8. Editor lists gain a fictitious person ✓ Resolved Medium
Description
handleNames iterates the parser's Author.OTHERS sentinel as if it were an editor and writes its
family value, others, as a personal name. When a newly supported editor field ends in the BibTeX
convention and others, the exported MODS record includes an editor who does not exist.

9. Unsupported name text vanishes on export ✓ Resolved Medium
Description
handleNames writes only the parsed family and given values, even when the parser retains an
unrecognized extended-name value solely in its source data. For a field such as nickname=Jane,
parsing produces neither exported name part, so the MODS name contains a role but no name text.

10. A double space splits one author in two ✓ Resolved Medium
Description
handleNames passes the field to AuthorList.parse, whose normalization replaces repeated spaces
with and when the field contains no comma. An entry with Jean  Paul Smith consequently exports
two names instead of one, even though the field contains no author separator.

11. Authors' initials gain unwanted periods ✓ Resolved Medium
Description
handleNames exports Author.getGivenName(), which has already passed through
addDotIfAbbreviation, rather than the given-name spelling in the field. For Smith, J, the
exported given part is J. instead of J; adjacent initials can also acquire spaces and separate
name parts.

12. Authors and editors lose name suffixes ✓ Resolved Medium
Description
handleNames writes the parsed family and given names but never writes Author.getNameSuffix().
For a valid name such as Smith, Jr., John, the parser retains Jr., but both author and editor
exports omit it.

13. Initials-only names lose their initials ✓ Resolved Medium
Description
handleNames reads only getGivenName() when writing given-name parts, although extended BibLaTeX
names can supply given-i without given. For an editor or author such as `given-i=JPS,
family=Harman, parsing retains JPS` separately but the exported name contains only the family
part.

14. Editor names return as authors on import ✓ Resolved Medium
Description
ModsExporter now writes editors as ` elements with an edt role, but ModsImporter.parseName`
ignores roles and adds every parsed name to its authors list. Importing an exported entry with
editors therefore puts those names in AUTHOR rather than restoring its EDITOR field.

15. Organization names absorb date parts on import ✓ Resolved Low
Description
For type="corporate" names, parseName joins every namePart with . , whatever its type
attribute is, so date (and any other typed) parts become part of the organization name. Before
this change, handleAuthorsInNamePart ignored date parts. MODS records from catalogues that
include a dated corporate name (for example, a body with 1990) now import as a single braced name
such as {Org. 1990}.

Grey Divider

Tip of the day
💡 Did you know, you can switch off images and animations for a plain-text comment

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@github-actions github-actions Bot mentioned this pull request Nov 25, 2026
2 tasks done
@github-actions github-actions Bot added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 25, 2026
@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Nov 26, 2026
@github-actions github-actions Bot added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed status: changes-required Pull requests that are not yet complete labels Nov 26, 2026
@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Nov 27, 2026
@github-actions github-actions Bot added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed status: changes-required Pull requests that are not yet complete labels Nov 27, 2026
@Siedlerchr

Copy link
Copy Markdown
Member

Thanks for the work so far, I weill take anothe rlook

@github-actions github-actions Bot added size: big component: import-load and removed size: medium status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Nov 28, 2026
@github-actions github-actions Bot added component: bib(la)tex status: changes-required Pull requests that are not yet complete labels Nov 28, 2026
@github-actions github-actions Bot added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed status: changes-required Pull requests that are not yet complete labels Nov 29, 2026
@github-actions github-actions Bot removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 29, 2026
@Siedlerchr
Siedlerchr enabled auto-merge November 29, 2026 12:45
@Siedlerchr
Siedlerchr added this pull request to the merge queue Nov 29, 2026
@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Nov 29, 2026
Merged via the queue into JabRef:main with commit b5a8d8f Nov 29, 2026
87 of 91 checks passed
@jabref-machine

Copy link
Copy Markdown
Collaborator

Created backport PR for black-forest:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin port-17936-to-black-forest
git worktree add --checkout .worktree/port-17936-to-black-forest port-17936-to-black-forest
cd .worktree/port-17936-to-black-forest
git reset --hard HEAD^
git cherry-pick -x b5a8d8f4a404e1e55da3ef98cb2dbef4149f0314

@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Nov 29, 2026
Siedlerchr added a commit to PedroSarmento2007/jabref that referenced this pull request Nov 29, 2026
* main: (35 commits)
  Fix author and editor name export in MODS format (JabRef#17936)
  Fix LaTeX conversion in exported PDF metadata (JabRef#17810)
  Fix preferences menu text (JabRef#17966)
  Skip forced full-text index merges on shutdown (JabRef#17961)
  Fix wrong bibo namespace in RDF export (JabRef#17842)
  New Crowdin updates (JabRef#17956)
  chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.4 (JabRef#17955)
  Let Renovate update JavaFX in the jabsrv launcher (JabRef#17954)
  chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.3 (JabRef#17953)
  Import the RIS serial number of books and chapters as ISBN (JabRef#17891)
  Share nested LaTeX conversion with Writer (JabRef#17921)
  Render BST preview italics and bold as text, not math letters (JabRef#17902)
  Chore(deps): Bump com.konghq:unirest-java-bom from 4.11.11 to 4.12.0 in /versions (JabRef#17951)
  Inject NativeDesktop into its callers and remove the deprecated static helpers (JabRef#17947)
  New Crowdin updates (JabRef#17945)
  Chore(deps): Bump org.graalvm.sdk:nativeimage from 25.5.5.0.3 to 25.6.5.1 in /versions (JabRef#17944)
  Chore(deps): Bump com.googlecode.plist:dd-plist from 1.30 to 1.31 in /versions (JabRef#17943)
  Chore(deps): Bump JetBrains/junie-github-action from 1.10.1 to 1.10.2 (JabRef#17942)
  Chore(deps): Bump softprops/action-gh-release from 3.0.3 to 3.0.4 (JabRef#17941)
  Chore(deps): Bump anthropics/claude-code-action from 1.0.286 to 1.0.289 (JabRef#17940)
  ...
Siedlerchr added a commit to gourprince222/jabref that referenced this pull request Nov 29, 2026
* main: (58 commits)
  Keep organization authors containing "and" intact in RIS export. (JabRef#17876)
  Fix author and editor name export in MODS format (JabRef#17936)
  Fix LaTeX conversion in exported PDF metadata (JabRef#17810)
  Fix preferences menu text (JabRef#17966)
  Skip forced full-text index merges on shutdown (JabRef#17961)
  Fix wrong bibo namespace in RDF export (JabRef#17842)
  New Crowdin updates (JabRef#17956)
  chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.4 (JabRef#17955)
  Let Renovate update JavaFX in the jabsrv launcher (JabRef#17954)
  chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.3 (JabRef#17953)
  Import the RIS serial number of books and chapters as ISBN (JabRef#17891)
  Share nested LaTeX conversion with Writer (JabRef#17921)
  Render BST preview italics and bold as text, not math letters (JabRef#17902)
  Chore(deps): Bump com.konghq:unirest-java-bom from 4.11.11 to 4.12.0 in /versions (JabRef#17951)
  Inject NativeDesktop into its callers and remove the deprecated static helpers (JabRef#17947)
  New Crowdin updates (JabRef#17945)
  Chore(deps): Bump org.graalvm.sdk:nativeimage from 25.5.5.0.3 to 25.6.5.1 in /versions (JabRef#17944)
  Chore(deps): Bump com.googlecode.plist:dd-plist from 1.30 to 1.31 in /versions (JabRef#17943)
  Chore(deps): Bump JetBrains/junie-github-action from 1.10.1 to 1.10.2 (JabRef#17942)
  Chore(deps): Bump softprops/action-gh-release from 3.0.3 to 3.0.4 (JabRef#17941)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: bib(la)tex component: export-or-save component: import-load dev: send-to-black-forest Port to the black-forest branch of JabRef/jabref-black-forest after merging (ADR-0073) first contrib size: big status: changes-required Pull requests that are not yet complete status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MODS export corrupts names fields

4 participants