Skip to content

Commit b873a78

Browse files
authored
Prevent spaces in custom entry (#14091)
* #14088 prevent custom entry types with spaces * #14088 update changelog * #14088 resolve LocalizationConsistencyTest * try rerun automated tests * remove trailing
1 parent 62a10b5 commit b873a78

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
154154
- We fixed an issue where ignoring of subdirectories via `.gitingore` patterns did not work in the "Find unlinked files dialog". [forum#5425](https://discourse.jabref.org/t/set-list-of-ignored-folders-paths/5425/6)
155155
- We fixed an issue where the "Applications to push entries to" list in the preferences was not sorted alphabetically. [#14058](https://github.com/JabRef/jabref/issues/14058)
156156
- We fixed an issue where notice text in AI chat was not automatically refreshed when the user changed preferences.[#13855](https://github.com/JabRef/jabref/issues/13855)
157+
- We fixed an issue where the user could add custom entry types with spaces in their names. [#14088](https://github.com/JabRef/jabref/issues/14088)
157158

158159
### Removed
159160

jabgui/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTabViewModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public CustomEntryTypesTabViewModel(BibDatabaseMode mode,
7272

7373
entryTypeValidator = new FunctionBasedValidator<>(
7474
entryTypeToAdd,
75-
StringUtil::isNotBlank,
76-
ValidationMessage.error(Localization.lang("Entry type cannot be empty. Please enter a name.")));
75+
input -> StringUtil.isNotBlank(input) && !input.contains(" "),
76+
ValidationMessage.error(Localization.lang("Entry type cannot be empty and must not contain spaces.")));
7777
fieldValidator = new FunctionBasedValidator<>(
7878
newFieldToAdd,
7979
input -> (input != null) && StringUtil.isNotBlank(FieldTextMapper.getDisplayName(input)),

jablib/src/main/resources/l10n/JabRef_en.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ Remove\ entry\ type=Remove entry type
22682268
Remove\ field\ %0\ from\ currently\ selected\ entry\ type=Remove field %0 from currently selected entry type
22692269
Optional=Optional
22702270
Required=Required
2271-
Entry\ type\ cannot\ be\ empty.\ Please\ enter\ a\ name.=Entry type cannot be empty. Please enter a name.
2271+
Entry\ type\ cannot\ be\ empty\ and\ must\ not\ contain\ spaces.=Entry type cannot be empty and must not contain spaces.
22722272
Field\ cannot\ be\ empty.\ Please\ enter\ a\ name.=Field cannot be empty. Please enter a name.
22732273
22742274
Capitalize\ current\ word=Capitalize current word

0 commit comments

Comments
 (0)