-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workaround missing "Optional 2" display #11022
Conversation
@@ -57,7 +57,7 @@ void setUp() { | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better use findFirst to get it ina reliable way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is only one standard type? Thus, I thought, findAny
could be faster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it matter in a test? have we ever had problems with reliability of these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.md
described in a way that is understandable for the average user (if applicable)