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

Auto-linking files with safe character replacements #9267

Closed
2 tasks done
paksnuk opened this issue Oct 19, 2022 · 3 comments · Fixed by #9316
Closed
2 tasks done

Auto-linking files with safe character replacements #9267

paksnuk opened this issue Oct 19, 2022 · 3 comments · Fixed by #9316
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs external files good first issue An issue intended for project-newcomers. Varies in difficulty.

Comments

@paksnuk
Copy link

paksnuk commented Oct 19, 2022

JabRef version

5.7 (latest release)

Operating system

Windows

Details on version and operating system

Windows 11 22H2

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

When using characters in the citation key or publication title that are unsafe for the file system (such as e.g. a colon ":"), the automatic file renaming replaces those characters with an underscore.
However, the auto-linking feature does not seem to respect this behaviour. After automatically renaming a file with an unsafe character and unlinking it, it is not being recognized by the auto-linking feature.
Changing the citation key to the "safe" string by manually replacing the colon with an underscore makes JabRef find the file again.

Auto-linking files didn't work at all for me in the development version, so I couldn't actually reproduce the behaviour there.

Appendix

...

Log File
Paste an excerpt of your log file here
@Siedlerchr Siedlerchr added external files good first issue An issue intended for project-newcomers. Varies in difficulty. labels Oct 19, 2022
@Siedlerchr Siedlerchr moved this to Free to take in Good First Issues Oct 19, 2022
@Siedlerchr Siedlerchr added the bug Confirmed bugs or reports that are very likely to be bugs label Oct 19, 2022
@Rita-Zhou
Copy link
Contributor

Hi, I would like to work on this issue, would you mind assign it to me, please? Thanks!

@ThiloteE ThiloteE moved this from Free to take to Reserved in Good First Issues Oct 21, 2022
@ThiloteE ThiloteE assigned Rita-Zhou and unassigned Rita-Zhou Oct 21, 2022
@Rita-Zhou
Copy link
Contributor

Hi, thank you so much for assigning this issue to me, I'm currently working on it. I tried all the steps to reproduce the behaviour and got an error message while I trying to rename the file name with a colon ":". Would you mind giving me more details about this issue? Thanks!
image

@paksnuk
Copy link
Author

paksnuk commented Oct 26, 2022

I'm not sure whether you're referring to me or to the maintainers, but I'm pretty sure that you shouldn't have a colon in the filename in the first place.
I believe the fix should be replacing the illegal characters in the search string for the auto-linking logic with underscores by the same schema that's being used for automatically naming files.

@ThiloteE ThiloteE moved this from Reserved to In Progress in Good First Issues Oct 30, 2022
Repository owner moved this from In Progress to Done in Good First Issues Oct 30, 2022
Siedlerchr pushed a commit that referenced this issue Oct 30, 2022
…9316)

* fix the safe character replacement and auto-linking the files

* Test the unsafe citation key attach the file.

* Change to citation key filter to the existing FileNameCleaner

* Add tests for "exact" and "startsWith" matches of auto-linking files

Co-authored-by: Xianghao Wang <[email protected]>
Siedlerchr added a commit to tomazari/jabref that referenced this issue Nov 1, 2022
…ok-info.com-JabRef#9145

* upstream/main:
  New Crowdin updates (JabRef#9333)
  Refresh example styles
  Squashed 'buildres/csl/csl-styles/' changes from 4eee79a..13fd98e
  Bump unirest-java from 3.13.11 to 3.13.12 (JabRef#9330)
  Bump checkstyle from 10.3.4 to 10.4 (JabRef#9331)
  Bump gittools/actions from 0.9.14 to 0.9.15 (JabRef#9332)
  Group context menu presents relevant options depending on number of subgroups (JabRef#9286)
  Removed BibTeX file type and included HTML and Markdown types (JabRef#9318)
  Fix issue: Auto-linking files with safe character replacements JabRef#9267 (JabRef#9316)
  Fix for issue 8806: Button highlights doesn't respect rounded corners (JabRef#9320)
  New Crowdin updates (JabRef#9324)
  Update CHANGELOG.md
  Try to relocate listener binding (JabRef#9238)
  Changed the messages after importing unlinked local files to past passive tense. (JabRef#9308)
  Changed the color of found text from red to high contrast  (JabRef#9315)

# Conflicts:
#	CHANGELOG.md
Siedlerchr added a commit to DavidOWade/jabref that referenced this issue Nov 3, 2022
* upstream/main: (30 commits)
  New translations JabRef_en.properties (German) (JabRef#9336)
  Fix Abbreviation for Escaped Ampersand (JabRef#9288)
  Fix font size preference not updating in preference dialog 8386 (JabRef#9287)
  New Crowdin updates (JabRef#9333)
  Refresh example styles
  Squashed 'buildres/csl/csl-styles/' changes from 4eee79a..13fd98e
  Bump unirest-java from 3.13.11 to 3.13.12 (JabRef#9330)
  Bump checkstyle from 10.3.4 to 10.4 (JabRef#9331)
  Bump gittools/actions from 0.9.14 to 0.9.15 (JabRef#9332)
  Group context menu presents relevant options depending on number of subgroups (JabRef#9286)
  Removed BibTeX file type and included HTML and Markdown types (JabRef#9318)
  Fix issue: Auto-linking files with safe character replacements JabRef#9267 (JabRef#9316)
  Fix for issue 8806: Button highlights doesn't respect rounded corners (JabRef#9320)
  New Crowdin updates (JabRef#9324)
  Update CHANGELOG.md
  Try to relocate listener binding (JabRef#9238)
  Changed the messages after importing unlinked local files to past passive tense. (JabRef#9308)
  Changed the color of found text from red to high contrast  (JabRef#9315)
  New Crowdin updates (JabRef#9317)
  Add skips for MacOS X build (JabRef#9305)
  ...
Siedlerchr added a commit that referenced this issue Nov 8, 2022
* upstream/main:
  New Crowdin updates (#9333)
  Refresh example styles
  Squashed 'buildres/csl/csl-styles/' changes from 4eee79a..13fd98e
  Bump unirest-java from 3.13.11 to 3.13.12 (#9330)
  Bump checkstyle from 10.3.4 to 10.4 (#9331)
  Bump gittools/actions from 0.9.14 to 0.9.15 (#9332)
  Group context menu presents relevant options depending on number of subgroups (#9286)
  Removed BibTeX file type and included HTML and Markdown types (#9318)
  Fix issue: Auto-linking files with safe character replacements #9267 (#9316)
  Fix for issue 8806: Button highlights doesn't respect rounded corners (#9320)
  New Crowdin updates (#9324)
  Update CHANGELOG.md
  Try to relocate listener binding (#9238)
  Changed the messages after importing unlinked local files to past passive tense. (#9308)
  Changed the color of found text from red to high contrast  (#9315)
  New Crowdin updates (#9317)
  Add skips for MacOS X build (#9305)
  New Crowdin updates (#9248)
  Fix for issue 9304 (#9313)

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs external files good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants