Skip to content

Commit 14bc706

Browse files
authored
Fix application not saved in external file type (JabRef#12321)
1 parent 4bfa588 commit 14bc706

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
126126
- We fixed an issue where identifier paste couldn't work with Unicode REPLACEMENT CHARACTER. [#11986](https://github.com/JabRef/jabref/issues/11986)
127127
- We fixed an issue when click on entry at "Check Integrity" wasn't properly focusing the entry and field. [#11997](https://github.com/JabRef/jabref/issues/11997)
128128
- We fixed an issue with the ui not scaling when changing the font size [#11219](https://github.com/JabRef/jabref/issues/11219)
129+
- We fixed an issue where a custom application for external file types would not be saved [#112311](https://github.com/JabRef/jabref/issues/12311)
129130

130131
### Removed
131132

src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTabViewModel.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ public boolean edit(ExternalFileTypeItemViewModel type) {
8282
ExternalFileTypeItemViewModel typeToModify = new ExternalFileTypeItemViewModel(type.toExternalFileType());
8383
showEditDialog(typeToModify, Localization.lang("Edit file type"));
8484

85-
if (!isValidExternalFileType(typeToModify)) {
85+
if (type.extensionProperty().get().equals(typeToModify.extensionProperty().get())) {
86+
if (withEmptyValue(typeToModify)) {
87+
LOGGER.warn("One of the fields is empty or invalid. Not saving.");
88+
return false;
89+
}
90+
} else if (!isValidExternalFileType(typeToModify)) {
8691
return false;
8792
}
8893

@@ -97,12 +102,12 @@ public void remove(ExternalFileTypeItemViewModel type) {
97102

98103
public boolean isValidExternalFileType(ExternalFileTypeItemViewModel item) {
99104
if (withEmptyValue(item)) {
100-
LOGGER.debug("One of the fields is empty or invalid.");
105+
LOGGER.warn("One of the fields is empty or invalid. Not saving.");
101106
return false;
102107
}
103108

104109
if (!isUniqueExtension(item)) {
105-
LOGGER.debug("File Extension exists already.");
110+
LOGGER.warn("File Extension already exists. Not saving.");
106111
return false;
107112
}
108113

0 commit comments

Comments
 (0)