Skip to content

Consistent casing in fieldnames#13867

Merged
koppor merged 29 commits intomainfrom
fix-inconsistent-casing
Sep 14, 2025
Merged

Consistent casing in fieldnames#13867
koppor merged 29 commits intomainfrom
fix-inconsistent-casing

Conversation

@calixtus
Copy link
Copy Markdown
Member

@calixtus calixtus commented Sep 12, 2025

Fixes #10590

see attached ADR

Steps to test

Look at entry editor and preferences for entry types

image image image image image

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • 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 described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • [.] I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

@calixtus calixtus changed the title Consistent naming of fields Consistent casing in fieldnames Sep 12, 2025
@calixtus calixtus marked this pull request as ready for review September 13, 2025 10:38
@calixtus calixtus requested a review from koppor September 13, 2025 10:38
@calixtus calixtus added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Sep 13, 2025
koppor and others added 7 commits September 13, 2025 15:07
…sing

# Conflicts:
#	jablib/src/main/java/org/jabref/model/entry/field/Field.java
…sing

# Conflicts:
#	config/IntelliJ Code Style.xml
#	jabgui/src/main/java/org/jabref/gui/consistency/ConsistencyCheckDialogViewModel.java
#	jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldNameLabel.java
#	jabgui/src/main/java/org/jabref/gui/fieldeditors/identifier/DoiIdentifierEditorViewModel.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/FieldMergerFactory.java
#	jabgui/src/main/java/org/jabref/gui/util/FieldsUtil.java
#	jablib/src/main/java/org/jabref/model/entry/field/FieldFactory.java

public class FieldTextMapper {
public static String getDisplayName(Field field) {
if (field.isStandardField()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future work is to add make use of org.jabref.model.entry.BibEntryTypesManager#isCustomOrModifiedType here. It is hard, because the parameter has the field only - and the field does not have a reference to its parent.

public static String getDisplayName(Field field) {
if (field.isStandardField()) {
StandardField standardField = (StandardField) field;
return switch (standardField) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice start so that we could customize

urldate to URL date or even Date of URL.

@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 Sep 13, 2025
koppor
koppor previously approved these changes Sep 13, 2025
Field Presence Consistency Check Result

| entry type | citation key | Custom | Pages | Title |
| entry type | citation key | custom | Pages | Title |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussion: I think, we should use the field name instead of the display name --> follow-up for someone else :)

koppor
koppor previously approved these changes Sep 14, 2025
Copy link
Copy Markdown
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your effort and endurance!!

@koppor koppor enabled auto-merge September 14, 2025 19:57
koppor
koppor previously approved these changes Sep 14, 2025
@koppor koppor added this pull request to the merge queue Sep 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 14, 2025
@koppor koppor added this pull request to the merge queue Sep 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 14, 2025
@calixtus calixtus added this pull request to the merge queue Sep 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 14, 2025
calixtus added a commit that referenced this pull request Sep 14, 2025
* Prototype

* Add ADR

* Modify ADR

* Fix tests

* Fix merge conflict

* CHANGELOG.md

* Fix APA fields

* Refine ADR

* typo

* Code formatting

* Remove capitalization from orfield

* Comment to ADR

* Remove forced lowercase of field names in bib file

* Fix tests

* Fix more tests

* Add special case for OpenOffice/LibreOffice

* Rewrite

* Suggestions

* Fix tests

---------

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Co-authored-by: Carl Christian Snethlage <calixtus@users.noreply.github.com>
@calixtus calixtus force-pushed the fix-inconsistent-casing branch from acada03 to d741bac Compare September 14, 2025 21:34
@trag-bot
Copy link
Copy Markdown

trag-bot bot commented Sep 14, 2025

@trag-bot didn't find any issues in the code! ✅✨

@koppor
Copy link
Copy Markdown
Member

koppor commented Sep 14, 2025

GitHub's UI does something wrong - d741bac is the right commit

image

This one is NOT in:

image

@koppor koppor enabled auto-merge September 14, 2025 21:38
@trag-bot
Copy link
Copy Markdown

trag-bot bot commented Sep 14, 2025

@trag-bot didn't find any issues in the code! ✅✨

@calixtus calixtus removed the status: changes-required Pull requests that are not yet complete label Sep 14, 2025
@koppor koppor added this pull request to the merge queue Sep 14, 2025
Merged via the queue into main with commit ccda46d Sep 14, 2025
84 of 85 checks passed
@koppor koppor deleted the fix-inconsistent-casing branch September 14, 2025 21:57
Siedlerchr added a commit that referenced this pull request Sep 17, 2025
* upstream/main:
  Add new check for format (#13909)
  Consistent casing in fieldnames (#13867)
  Revert "Pressing TAB in last field in entry editor moves focus to the next ta…" (#13912)
  Fix YAML
  Fix on-pr-opened-updated.yml syntax
  Pressing TAB in last field in entry editor moves focus to the next tab's first field  (#13870)
  Modularize JabSrv (#13908)
  New translations jabref_en.properties (Italian) (#13907)
  Remove wrong `assert` statement (#13906)
  Add .git-blame-ignore-revs (#13884)
  Do not show transprot info messages (#13904)
  Pubmed api key support (#13899)
  Fix warnings for native access
  Fix automerge workflow (#13903)
  Add comment on issue on binary (#13902)
  Have checkstyle and VCS configuration distributed (#13900)
  Add unknown field to lsp consistency check (#13880)
  Put config for general tab if missing (#13901)
  Fix autosave manager exception on shutdown (#13882)
@calixtus calixtus mentioned this pull request Oct 19, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent casing of custom field names

2 participants