diff --git a/CHANGELOG.md b/CHANGELOG.md index 5419597820b..8a8a9c7dc3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java index 05233f2abdc..14534d0912a 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java @@ -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) @@ -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 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()) {