diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e91f5ae991..c83a4906cc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - The last page of a PDF is now indexed by the full text search. [#10193](https://github.com/JabRef/jabref/issues/10193) - We fixed an issue where the duplicate check did not take umlauts or other LaTeX-encoded characters into account. [#10744](https://github.com/JabRef/jabref/pull/10744) - We fixed the colors of the icon on hover for unset special fields. [#10431](https://github.com/JabRef/jabref/issues/10431) +- We fixed an issue where the CrossRef field did not work if autocompletion was disabled [#8145](https://github.com/JabRef/jabref/issues/8145) ### Removed diff --git a/src/main/java/org/jabref/gui/LibraryTab.java b/src/main/java/org/jabref/gui/LibraryTab.java index ea00153a7a4..66b1c4588ec 100644 --- a/src/main/java/org/jabref/gui/LibraryTab.java +++ b/src/main/java/org/jabref/gui/LibraryTab.java @@ -568,8 +568,8 @@ private void setupAutoCompletion() { if (autoCompletePreferences.shouldAutoComplete()) { suggestionProviders = new SuggestionProviders(getDatabase(), Globals.journalAbbreviationRepository, autoCompletePreferences); } else { - // Create empty suggestion providers if auto-completion is deactivated - suggestionProviders = new SuggestionProviders(); + // Create suggestion providers with database for crossref if auto-completion is deactivated + suggestionProviders = new SuggestionProviders(getDatabase()); } searchAutoCompleter = new PersonNameSuggestionProvider(FieldFactory.getPersonNameFields(), getDatabase()); } diff --git a/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java b/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java index 06d2abef8a8..7d023f4d815 100644 --- a/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java +++ b/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java @@ -22,12 +22,21 @@ public SuggestionProviders(BibDatabase database, JournalAbbreviationRepository a this.isEmpty = false; } + public SuggestionProviders(BibDatabase database) { + this.database = database; + this.isEmpty = true; + } + public SuggestionProviders() { this.isEmpty = true; } public SuggestionProvider getForField(Field field) { if (isEmpty || !autoCompletePreferences.getCompleteFields().contains(field)) { + Set fieldProperties = field.getProperties(); + if (fieldProperties.contains(FieldProperty.SINGLE_ENTRY_LINK)) { + return new BibEntrySuggestionProvider(database); + } return new EmptySuggestionProvider(); }