Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where the article title with colon fails to download the arXiv link (pdf file). [#7660](https://github.com/JabRef/issues/7660)
- We fixed an issue where the keybinding for delete entry did not work on the main table [7580](https://github.com/JabRef/jabref/pull/7580)
- We fixed an issue where the RFC fetcher is not compatible with the draft [7305](https://github.com/JabRef/jabref/issues/7305)
- We fixed an issue where the `Aux file` on `Edit group` doesn't support relative sub-directories path to import. [#7719](https://github.com/JabRef/jabref/issues/7719).
- We fixed an issue where duplicate files (both file names and contents are the same) is downloaded and add to linked files [#6197](https://github.com/JabRef/jabref/issues/6197)
- We fixed an issue where changing the appearance of the preview tab did not trigger a restart warning. [#5464](https://github.com/JabRef/jabref/issues/5464)

Expand Down
14 changes: 12 additions & 2 deletions src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ private void setupValidation() {
if (StringUtil.isBlank(input)) {
return false;
} else {
Path texFilePath = preferencesService.getWorkingDir().resolve(input);
if (!Files.isRegularFile(texFilePath)) {
Path inputPath = getAbsoluteTexGroupPath(input);
if (!inputPath.isAbsolute() || !Files.isRegularFile(inputPath)) {
return false;
}
return FileUtil.getFileExtension(input)
Expand Down Expand Up @@ -263,6 +263,16 @@ private void setupValidation() {
});
}

/**
* Gets the absolute path relative to the LatexFileDirectory, if given a relative path
* @param input the user input path
* @return an absolute path if LatexFileDirectory exists; otherwise, returns input
*/
private Path getAbsoluteTexGroupPath(String input) {
Optional<Path> latexFileDirectory = currentDatabase.getMetaData().getLatexFileDirectory(preferencesService.getUser());
return latexFileDirectory.map(path -> path.resolve(input)).orElse(Path.of(input));
}

public void validationHandler(Event event) {
ValidationStatus validationStatus = validator.getValidationStatus();
if (validationStatus.getHighestMessage().isPresent()) {
Expand Down