Skip to content

If user moved file, it should simply be relinked - [Entry Editor part] #13264

@koppor

Description

@koppor

A user might move files in the file directory without JabRef.

Then, JabRef does not find the file:

Image

But it still exists.

Example:

  1. Open `test-support\src\manual-tests\issue-9798\issue-9798.bib in JabRef
  2. Double click on the only entry to open the entry editor
  3. Select tab "General"
  4. See orange behind "minimal.pdf"
    Image

Normally org.jabref.gui.fieldeditors.LinkedFilesEditorViewModel#findAssociatedNotLinkedFiles is called (from org.jabref.gui.fieldeditors.LinkedFilesEditorViewModel#bindToEntry)

Task:

  1. Write test in org.jabref.gui.externalfiles.AutoSetFileLinksUtilTest for this case
  2. Adapt org.jabref.gui.externalfiles.AutoSetFileLinksUtil to cover the case searching for the filename (in addition to citation key logic).
  3. Ensure that new logic ignores already linked files (e.g., if "minimal.pdf" is already attached to another entry)
  4. Add test org.jabref.gui.externalfiles.AutoSetFileLinksUtilTest (if not already covered by 1)
  5. Test in JabRef GUI

One has to ensure that "automatically search and show unlinked files" is activated

Image

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions