Workaround missing "Optional 2" display#11022
Conversation
|
|
||
| private BibEntryType getStandardArticleType(BibDatabaseMode mode) { | ||
| return entryTypesManager.getEntryTypes(mode).standardTypes.stream().filter(t -> StandardEntryType.Article.equals(t.getType())).findAny().get(); | ||
| return entryTypesManager.getEntryTypes(mode).standardTypes.stream().filter(t -> StandardEntryType.Article == t.getType()).findAny().get(); |
There was a problem hiding this comment.
Better use findFirst to get it ina reliable way
There was a problem hiding this comment.
There is only one standard type? Thus, I thought, findAny could be faster?
There was a problem hiding this comment.
does it matter in a test? have we ever had problems with reliability of these tests?
There was a problem hiding this comment.
I think, somewhere in the main code, I also had it. Chris might be afraid of "Heisenbugs" :)
# Conflicts: # src/main/java/org/jabref/model/entry/BibEntryTypesManager.java
|
I added a test to illustrate the issue - |
|
I am now constantly getting library changed messages when entering texst: |
|
The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build. |
|
Cannot reproduce on Could reproduce once in this branch. Restarted JabRef startet with the file again. Could not trigger the issue again. -- @Siedlerchr Do you remember what steps you did? :) |
|
I could reproduce it when adding spaces to the citation key and then pressing "Dismiss Changes". Then saving. Then "Dismiss Changes". |
In biblatex mode, when resetting the preferences, JabRef displayed "Optional fields" and "Optional fields 2":
When opening the preferences, navigating to "customize entry types" and immediately saving, the "Optional fields 2" disappears and only "Optional fields" are displayed. Moreover, there is no choice between required fields (e.g., author or editor), JabRef now requires both.
This PR adds a work around: Customized entry types are only stored by JabRef if there was any change. If the fields required and optional are the same as in the respective standard type, there is no writing (and no handling). Thus "Optional fields 2" will stay for non-customized types.
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)