Skip to content

Commit 593b235

Browse files
authored
Merge pull request #6643 from alex-petrov-vt/fix-for-6604
Fixed error when specifying general fields by correcting unwanted characters list
2 parents 3b4f5ab + ad214af commit 593b235

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
1111

1212
### Added
1313

14+
- We improved responsiveness of general fields specification dialog window. [#6643](https://github.com/JabRef/jabref/issues/6604)
1415
- We added support for importing ris file and load DOI [#6530](https://github.com/JabRef/jabref/issues/6530)
1516
- We added the Library properties to a context menu on the library tabs [#6485](https://github.com/JabRef/jabref/issues/6485)
1617
- We added a new field in the preferences in 'BibTeX key generator' for unwanted characters that can be user-specified. [#6295](https://github.com/JabRef/jabref/issues/6295)

src/main/java/org/jabref/gui/customizefields/CustomizeGeneralFieldsDialogViewModel.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ public void saveFields() {
5858
return;
5959
}
6060

61-
String testString = CitationKeyGenerator.cleanKey(parts[1], preferences.getUnwantedCharacters());
62-
if (!testString.equals(parts[1]) || (parts[1].indexOf('&') >= 0)) {
61+
// Use literal string of unwanted characters specified below as opposed to exporting characters
62+
// from preferences because the list of allowable characters in this particular differs
63+
// i.e. ';' character is allowed in this window, but it's on the list of unwanted chars in preferences
64+
String unwantedChars = "#{}()~,^&-\"'`ʹ\\";
65+
String testString = CitationKeyGenerator.cleanKey(parts[1], unwantedChars);
66+
if (!testString.equals(parts[1])) {
6367
dialogService.showInformationDialogAndWait(
6468
Localization.lang("Error"),
6569
Localization.lang("Field names are not allowed to contain white spaces or certain characters (%0).",

0 commit comments

Comments
 (0)