JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.53k stars 2.47k forks source link

Default file location is ignored with auto cleanup #7658

Open funnym0nk3y opened 3 years ago

funnym0nk3y commented 3 years ago
JabRef 5.2--2020-12-24--6a2a512 Windows 10 10.0 amd64 Java 14.0.2

When trying to cleanup all the entries the option to move the files into the default location ignores my global settings aswell as the settings for my bib file, where the default location is set. All the files get moved to the folder where the .bib-file lives.

grafik

grafik

grafik

grafik

Maybe that is an issue on my part, which does not require a bug report, but I don't know what could be wrong.

Melchior-S commented 3 years ago

I am having a similar issue. When trying to move files to the default file location files are copied to the bibfile location even though I have set the default file location. This happens if I use cleanup entries (Alt + F8) or the right click menu option for moving files.

In the cleanup entries menu the bibfile directory path is displayed as the target path for moving files (at least I know where to find them). image

I have defined my general file directory as a relative path. I thought this might be causing the issues but updating it to a fixed path did not fix the issue.

k3KAW8Pnf7mkmdSMPHz27 commented 3 years ago

@funnym0nk3y are you also using relative file locations?

@Melchior-S have you tried using the user specific library location? I am not sure how well it works for your setup (I am only using one computer)

I also wanted to make sure that you have disabled the "Search and store files relative to library file location" in "JabRef Preferences" -> "Linked files".

Melchior-S commented 3 years ago

@k3KAW8Pnf7mkmdSMPHz27 Sorry yes "Search and store files relative to library file location" was enabled. Disabling this feature resolves my issues.

Its a fresh install of V5.3. Not sure if this is a configuration that was bought across from my previous configuration or if it was enabled by default.

funnym0nk3y commented 3 years ago

@k3KAW8Pnf7mkmdSMPHz27 Yes, I want to use relative locations. Is there an issue with relative locations?

Melchior-S commented 3 years ago

@funnym0nk3y, just in case this is useful to you. My general file directory for my library is defined as a relative directory "../../Papers" (two directories up and in a folder called papers). With relative locations disabled my documents are still correctly copied to this location when I select clean-up entries or right click move to file location. However, if your files are stored in multiple locations that you would like to be relative to your bib file then this will probably not be useful to you.

@k3KAW8Pnf7mkmdSMPHz27 To test for you I tried using user specific file locations with "Search and store files relative to library file location" enables. The behaviour was the same as for general file directories. Files were copied to the .bib file location.

Siedlerchr commented 3 years ago

@Melchior-S @funnym0nk3y I am having troubles to understand if this works now for you or not. To make the process a bit more clear:

JabRef uses the first existing file directory it finds in this order:

  1. Library settings: User specific file directory; Can be relative
  2. Library settings: General file directory; Can be relative
  3. Options → Preferences → Linked files, item Main file directory. This must be an absolute path
  4. Overwrites all other variants if checked: Options -> Preferences -> Linked Files ("search and store files relative to library file location") aka Bib file location

This is exactly what the File Cleanup does at well. It first locates the file at its current (source/old) location and then moves it to the target.

Afterwards, in the cleanup the paths are relativized to the new directory (if the option is checked)

funnym0nk3y commented 3 years ago

I tried it with the following settings:

  1. .\Dateien
  2. .\Dateien
  3. Pointing to the same directory, but with an absolute path.
  4. Unchecked

Now all the files are not found anymore. When linking them again it seems to work.

Melchior-S commented 3 years ago

@Siedlerchr Sorry if my last post was unclear.

As stated in a previous post above if I disable "Search and store files relative to library file location" then files are copied to the file location I specify in the "library settings: General file directory". Based on the directory search order you listed above it seems everything is working as intended.

To me it is just not intuitive that the general Jabref preference "Search and store files relative to library file location" overrides library specific file locations for storing files. I would expect library specific options to take priority over general options. As it seems the issues I was having is not a bug this is probably not the place to address this.

koppor commented 2 years ago

@Melchior-S Your last comment is IMHO the issue I encountered today: https://github.com/JabRef/jabref/issues/8179. Could you please try today's development version and see if that fixed your issue, too?

Melchior-S commented 2 years ago

@koppor I have installed todays development version. Since the update cleanup entries or selecting the file path in the entry editor and selecting "Move file to file directory" does not seem to have any affect on the file location. I tested this with "Search and store files relative to library file location" enabled and with it disabled (main file directory enabled).

I get the following response with either selection:

I hope this information helps.

koppor commented 2 years ago

Blocked by https://github.com/JabRef/jabref/issues/8182. After that issue is resolved, we need to investigatge this again.