Skip to content
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

When copying an entry to a library in another folder, the relative path to linked files should be updated #3953

Closed
erelsgl opened this issue Apr 13, 2018 · 9 comments

Comments

@erelsgl
Copy link

erelsgl commented Apr 13, 2018

JabRef version:
JabRef 4.2-dev--snapshot--2018-04-13--master--68b37978a
Linux 4.4.0-119-generic amd64
Java 1.8.0_161

Steps to reproduce:

  1. Open a library in folder A.
  2. Attach to one of the entries, a file in a subfolder of A.
  3. Open another library in folder B.
  4. Copy the entry from library A to library B.
  5. Try to open the file from the entry in library B.

The file does not open. The file-link is copied as a relative path, so it is invalid.

@stefan-kolb
Copy link
Member

stefan-kolb commented Apr 16, 2018

The correct algorithm for this is not immediately evident I think.
It depends on the usage pattern of the user.

  • If the user uses one directory for all full-text PDFs, the current strategy of copying the entry 1-1 is correct
  • If the user uses subfolders adjascent to the Bib file, we need to transform all relative URIs to absolute URIs. However, the library won't work on another PC then!
  • If the user uses absolute URIs, the current strategy is correct

The question is, what usage pattern is most frequently used? I guess the first one.
If someone uses another pattern I think there needs to be a cleanup operation or link and remove not found files for it. I'm not sure if there isn't an action available right now (Find unlinked files?!)

@Siedlerchr
Copy link
Member

JabRef has always been using relative links where possible for files. So this correct expected behavior.
And it still works if both lib A and lib B are in the same folder.

@erelsgl
Copy link
Author

erelsgl commented Apr 16, 2018 via email

@tobiasdiez
Copy link
Member

What might work in all cases:

  • Upon copy, convert all linked files to absolute paths
  • Upon paste, make paths relative (with respect to the current library / pdf folder)

@stefan-kolb
Copy link
Member

@tobiasdiez Sounds reasonable, but is it really worth? If a PDF is not inside one of the relative paths of the library or the bib file, I see no value by doing this. Additionally, it introduces more complexity for us.

@koppor
Copy link
Member

koppor commented Jun 1, 2018

We do not get the concrete use case. Is it about sharing?

I had similar case with copying PDFs to another folder, but I had no use case with linking.

@koppor
Copy link
Member

koppor commented Sep 1, 2020

The discussion seems to be that there are users having bib files in sub directories. Maybe some paper work. The thing is we should try not to contradict possible workflows.

Refs #160

I like the solution outlined at #3953 (comment)

@github-actions
Copy link
Contributor

This issue has been inactive for half a year. Since JabRef is constantly evolving this issue may not be relevant any longer and it will be closed in two weeks if no further activity occurs.

As part of an effort to ensure that the JabRef team is focusing on important and valid issues, we would like to ask if you could update the issue if it still persists. This could be in the following form:

  • If there has been a longer discussion, add a short summary of the most important points as a new comment (if not yet existing).
  • Provide further steps or information on how to reproduce this issue.
  • Upvote the initial post if you like to see it implemented soon. Votes are not the only metric that we use to determine the requests that are implemented, however, they do factor into our decision-making process.
  • If all information is provided and still up-to-date, then just add a short comment that the issue is still relevant.

Thank you for your contribution!

@claell
Copy link
Contributor

claell commented May 1, 2022

The issue seems to be still relevant. I came across it having the following in mind:

I will likely have several, project related .bib files. Additionally, I plan to have a large .bib file collecting relevant entries from the project related files. For that, I plan to manually copy entries. That will likely also involve copying the files and updating the links.

The question is, what mechanism can best help with this workflow. Automatically copying files over to a correct location will likely not work. But keeping the link working probably will help with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: For Future
Development

No branches or pull requests

6 participants