Skip to content

Commit

Permalink
Fix for issue 8396: filter out the empty field (#8783)
Browse files Browse the repository at this point in the history
Co-authored-by: tomlin <tomlin@tomlins-mbp.lan>
Co-authored-by: Christoph <siedlerkiller@gmail.com>
  • Loading branch information
3 people committed May 12, 2022
1 parent 6b9b84e commit 8bd859d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

- We fixed the unnecessary horizontal scroll bar in group panel [#8467](https://github.com/JabRef/jabref/issues/8467)
- We fixed an issue where the notification bar message, icon and actions appeared to be invisible. [#8761](https://github.com/JabRef/jabref/issues/8761)
- We fixed an issue where deprecated fields tab is shown when the fields don't contain any values. [#8396](https://github.com/JabRef/jabref/issues/8396)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.Collections;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import javax.swing.undo.UndoManager;

Expand Down Expand Up @@ -53,7 +54,7 @@ public DeprecatedFieldsTab(BibDatabaseContext databaseContext,
protected Set<Field> determineFieldsToShow(BibEntry entry) {
Optional<BibEntryType> entryType = entryTypesManager.enrich(entry.getType(), databaseContext.getMode());
if (entryType.isPresent()) {
return entryType.get().getDeprecatedFields();
return entryType.get().getDeprecatedFields().stream().filter(field -> !entry.getField(field).isEmpty()).collect(Collectors.toSet());
} else {
// Entry type unknown -> treat all fields as required
return Collections.emptySet();
Expand Down

0 comments on commit 8bd859d

Please sign in to comment.