-
-
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
Fix application not saved in external file type #12321
Conversation
The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build. |
The PR is a follow-up to #10496. |
@@ -82,7 +82,12 @@ public boolean edit(ExternalFileTypeItemViewModel type) { | |||
ExternalFileTypeItemViewModel typeToModify = new ExternalFileTypeItemViewModel(type.toExternalFileType()); | |||
showEditDialog(typeToModify, Localization.lang("Edit file type")); | |||
|
|||
if (!isValidExternalFileType(typeToModify)) { | |||
if (type.extensionProperty().get().equals(typeToModify.extensionProperty().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.
I have no clue why this works. Can you add a Java comment?
In my understanding, this evaluates to true if the extension is the same (either empty or set). Then the check withEmptyValue
is done.
In the "old" branch, the withEmptyValue
is also done (indirectly via isValidExternalFileType
.
I really don't get why this fixes the issue ^^.
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.
The isValidExternalType checks if the file extension is already used before. This will always return true in the case of edit and return false -> thus you can never edit one file typ entry.
Therefore, we check if we still have the same extension -> we just edited an existing one by e.g. changing the application path
Fixes #12311
File extension uniqueness checks does not make sense oneedit when ext didn't change
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)