Fix duplicate entry types causing wrong fields after tab switch (#14985)#15052
Conversation
Review Summary by QodoFix duplicate entry types causing wrong fields after tab switch
WalkthroughsDescription• Remove duplicate Legal, Jurisdiction, Legislation entries from non-standard enum • Move APA entry types to non-standard UI section for consistency • Fix field resolution to prevent wrong fields after tab switching • Add APA-specific entry type descriptions and handling Diagramflowchart LR
A["BiblatexNonStandardEntryType<br/>enum"] -->|remove duplicates| B["12 non-standard types<br/>Legal/Jurisdiction/Legislation removed"]
C["BiblatexAPAEntryType<br/>enum"] -->|combine with| D["Non-standard types<br/>submenu in UI"]
B -->|unified| D
D -->|prevents| E["Correct field resolution<br/>on tab switch"]
File Changes1. jabgui/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java
|
Code Review by Qodo
1. Missing locale keys
|
✅ All tests passed ✅🏷️ Commit: f5deb3b Learn more about TestLens at testlens.app. |
this was intentional as i think jabref uses crowdin to deal with translations |
|
Tried this PR and looks relatively good so far. The issues in the entry editor are gone and the saving works fine. Issue solved. Unfortunately I found a new issue: #15074. So we need testing, if custom entry types with similar names as those non-standard entrytypes will be overwritten when upgrading from 5.15 to 6.0 and if so, we should discuss, if we need some kind of migration in place or prevent that from happening. Probably something for a dev-call. How to create a custom entry type is documented at https://docs.jabref.org/setup/customentrytypes. I also found an issue that I documented at #11589 (comment), but that's not something you have to fix in this PR. |
Siedlerchr
left a comment
There was a problem hiding this comment.
remove entry from changelog
Siedlerchr
left a comment
There was a problem hiding this comment.
The issue mentioned by Thilo is not related to this PR
Is it though? Imagine a user having a custom entry type "video" with custom field "length" as required field in JabRef 5.15. Now they update to 6.0 and their custom entry type "video" might be overwritten with the non-standard entry type "video" that does NOT have "length" as required field. Which one wins? Need to test. |
|
The point of this PR was to revert the overlapping of the APA and non standard types. Not about custom entry types in general. |
"video" is now a StandardType (in the wording of JabRef), isn't it? Customization of these types was introduced 2016 at #2331. Interesting: The question of standard types was asked mid-2017 at #2331 (comment) - and left un-answered. --> Issue JabRef#248 |
Closes #14984
Closes #14985
Three entry types Legal, Jurisdiction, and Legislation were defined in both
BiblatexNonStandardEntryTypeandBiblatexApaEntryTypewith different field definitions. When switching tabs in the entry editor, JabRef would re-resolve the type name and pick up the wrong definition (APA vs non-standard), causing required fields to change unexpectedly. This PR removes the duplicates from the non-standard enum, keeping only the APA versions which have the correct specialized fields, and moves all APA types into the "Non-standard types" UI section so they remain accessible.Steps to test
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)