Skip to content

Commit

Permalink
Fix properly resolves OrFields of required fields (#5903)
Browse files Browse the repository at this point in the history
* adding all entries of OrFields to the list of required fields for the tab "Required fields" of the entry editor

* changelog extended

* Fix checkstyle

Co-authored-by: Tobias Diez <tobiasdiez@gmx.de>
  • Loading branch information
systemoperator and tobiasdiez authored Feb 2, 2020
1 parent 55ff1c4 commit 06f2c18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where an erroneous "The library has been modified by another program" message was shown when saving. [#4877](https://github.com/JabRef/jabref/issues/4877)
- We fixed an issue where the file extension was missing after downloading a file (we now fall-back to pdf). [#5816](https://github.com/JabRef/jabref/issues/5816)
- We fixed an issue where cleaning up entries broke web URLs, if "Make paths of linked files relative (if possible)" was enabled, which resulted in various other issues subsequently. [#5861](https://github.com/JabRef/jabref/issues/5861)
- We fixed an issue where the tab "Required fields" of the entry editor did not show all required fields, if at least two of the defined required fields are linked with a logical or.
- We fixed several issues concerning managing external file types: Now everything is usable and fully functional. Previously, there were problems with the radio buttons, with saving the settings and with loading an input field value. Furthermore, different behavior for Windows and other operating systems was given, which was unified as well. [#5846](https://github.com/JabRef/jabref/issues/5846)

### Removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Optional;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.stream.Collectors;

import javax.swing.undo.UndoManager;

Expand Down Expand Up @@ -43,7 +42,9 @@ protected SortedSet<Field> determineFieldsToShow(BibEntry entry) {
Optional<BibEntryType> entryType = entryTypesManager.enrich(entry.getType(), databaseContext.getMode());
SortedSet<Field> fields = new TreeSet<>(Comparator.comparing(Field::getName));
if (entryType.isPresent()) {
fields.addAll(entryType.get().getRequiredFields().stream().map(OrFields::getPrimary).collect(Collectors.toSet()));
for (OrFields orFields : entryType.get().getRequiredFields()) {
fields.addAll(orFields);
}
// Add the edit field for Bibtex-key.
fields.add(InternalField.KEY_FIELD);
} else {
Expand Down

0 comments on commit 06f2c18

Please # to comment.