Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for issue #7719: The "Aux file" on "Edit group" doesn't support relative sub-directories path #7728
Fix for issue #7719: The "Aux file" on "Edit group" doesn't support relative sub-directories path #7728
Changes from 1 commit
a779428
5f11f2d
57f1861
89c95fa
77f647b
887e31b
aae330f
e7c8131
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for looking at the issue!
Perhaps the changes should be added with
jabref/src/main/java/org/jabref/model/groups/TexGroup.java
Lines 134 to 143 in 807f85e
instead. Wouldn't they break paths relative to the "latex directory" otherwise? (refs #4792)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for your suggestion. Do you mean that it is better to add the
preferencesService.getWorkingDir()
to file path inexpandPath(Path path)
method instead of in jabref/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java. Could you explain it a little further?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite frankly I am not really sure what is going on with
getWorkingDir()
, but the "working dir" is changed if you open a different library which is strange behavior.I think you are right about it not breaking the "latex directory". There is a bug in the
texGroupFilePathValidator
that makes it not work as I'd expect (that is unrelated to your changes).I think so. I'll try to think a bit more about it, but I would prefer if someone in the future will be able to use the
TexGroup.expandPath
method (or a similar method) to fix the bug intexGroupFilePathValidator
. That the path to a valid absolute or relative.aux
-file is created in the same method (DRY).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are your thoughts about using the
currentDatabase.getDatabasePath()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I print "working dir" out and it always turns out to be the home dir for current user(Mac OS).
I have tried some input and find that
currentDatabase.getDatabasePath()
is empty. I am not quite sure ifmetaData.getLatexFileDirectory(user)
andcurrentDatabase.getDatabasePath()
are the same. I think explicitly settingcurrentDatabase.getDatabasePath()
to working dir doesn't sound good as well.There is also another way to fix it. Remove the automatically added "working dir" in
texGroupFilePathValidator
and always let users input a absolute path or use the browser button. This can make it simple, since probablygetWorkingDir()
's behaviour is wired.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getLatexFileDirectory
can be manually set by the user and is intended to allow relative paths to a user-specified directory (the menuLibrary
->Library properties
) for.aux
filesgetDatabasePath
should give you the path to the .bib file. It should be used by the "Reveal in file explorer" function. (From the JavaDoc)Get the path where this database was last saved to or loaded from, if any.
Agreed.
I think you are right in that the "working dir" should be removed from the
texGroupFilePathValidator
. Perhaps its behavior can be made more aligned withjabref/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java
Lines 422 to 431 in 84c8849
It seems like there is a wish to be able to use relative paths, which were the intent of the latex file directory. What are your thoughts about attempting to get it working again and updating the documentation?
I don't know if there is a "default" directory it would make sense to look for
.aux
files in, but perhaps it isn't too much to ask of a user to specify that directory.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have set the base for relative filePath as
getLatexFileDirectory()
and I have try some test cases manually and it can work. Point it out if there is any problem.