Skip to content

Commit

Permalink
Fix application not saved in external file type (JabRef#12321)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr authored Dec 21, 2024
1 parent 4bfa588 commit 14bc706
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where identifier paste couldn't work with Unicode REPLACEMENT CHARACTER. [#11986](https://github.com/JabRef/jabref/issues/11986)
- 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)
- We fixed an issue with the ui not scaling when changing the font size [#11219](https://github.com/JabRef/jabref/issues/11219)
- We fixed an issue where a custom application for external file types would not be saved [#112311](https://github.com/JabRef/jabref/issues/12311)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
if (withEmptyValue(typeToModify)) {
LOGGER.warn("One of the fields is empty or invalid. Not saving.");
return false;
}
} else if (!isValidExternalFileType(typeToModify)) {
return false;
}

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

public boolean isValidExternalFileType(ExternalFileTypeItemViewModel item) {
if (withEmptyValue(item)) {
LOGGER.debug("One of the fields is empty or invalid.");
LOGGER.warn("One of the fields is empty or invalid. Not saving.");
return false;
}

if (!isUniqueExtension(item)) {
LOGGER.debug("File Extension exists already.");
LOGGER.warn("File Extension already exists. Not saving.");
return false;
}

Expand Down

0 comments on commit 14bc706

Please sign in to comment.