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

"Open File" doesn't lead anywhere #10959

Closed
2 tasks done
siainbuletin opened this issue Mar 2, 2024 · 14 comments · Fixed by #11038
Closed
2 tasks done

"Open File" doesn't lead anywhere #10959

siainbuletin opened this issue Mar 2, 2024 · 14 comments · Fixed by #11038
Labels
component: bib(la)tex component: external-files [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs

Comments

@siainbuletin
Copy link

siainbuletin commented Mar 2, 2024

JabRef version

5.12 (latest release)

Operating system

Windows

Details on version and operating system

Windows 11 v23H2 (OS Build 22631.3235)

Checked with the latest development build (copy version output from About dialog)

  • 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

  1. Open my BibLaTeX file exported from Zotero with the file directory set on the Zotero/storage folder.
  2. Click on an article that has an associated PDF (the correct path is associated in the BibLaTex entry, as seen below):

image

  1. Pressing F4 or going to the context menu simply directs me to my regular C:/Users//Documents directory.

Appendix

...

Log File
2024-03-02 17:15:58 [JavaFX-Launcher] sun.util.logging.internal.LoggingProviderImpl$JULWrapper.log()
WARN: Unsupported JavaFX configuration: classes were loaded from 'module org.jabref.merged.module', isAutomatic: false, isOpen: true
2024-03-02 17:15:59 [JavaFX Application Thread] org.jabref.gui.StateManager.setActiveDatabase()
INFO: No open database detected
2024-03-02 17:15:59 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Not updating theme because it hasn't changed
2024-03-02 17:15:59 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Theme set to Theme{type=DEFAULT, name=''} with base css StyleSheet{jrt:/org.jabref/org/jabref/gui/Base.css}
2024-03-02 17:15:59 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Not updating theme because it hasn't changed
2024-03-02 17:15:59 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Theme set to Theme{type=DEFAULT, name=''} with base css StyleSheet{jrt:/org.jabref/org/jabref/gui/Base.css}
2024-03-02 17:15:59 [JavaFX Application Thread] sun.util.logging.internal.LoggingProviderImpl$JULWrapper.log()
WARN: Resource "" not found.
2024-03-02 17:16:01 [JavaFX Application Thread] sun.util.logging.internal.LoggingProviderImpl$JULWrapper.log()
WARN: Resource "" not found.
2024-03-02 17:16:11 [pool-1-thread-1] org.jabref.gui.JabRefDialogService.notify()
INFO: Opening: 'A:\bib\My Library.bib'
2024-03-02 17:16:13 [JavaFX Application Thread] org.jabref.gui.FallbackExceptionHandler.uncaughtException()
ERROR: Uncaught exception occurred in Thread[#60,JavaFX Application Thread,5,main]: java.nio.file.InvalidPathException: Trailing char < > at index 16:  Analitica primă 
	at java.base/sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
	at java.base/sun.nio.fs.WindowsPathParser.parse(Unknown Source)
	at java.base/sun.nio.fs.WindowsPathParser.parse(Unknown Source)
	at java.base/sun.nio.fs.WindowsPath.parse(Unknown Source)
	at java.base/sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
	at java.base/java.nio.file.Path.of(Unknown Source)
	at [email protected]/org.jabref.logic.importer.util.FileFieldParser.convert(Unknown Source)
	at [email protected]/org.jabref.logic.importer.util.FileFieldParser.parse(Unknown Source)
	at [email protected]/org.jabref.logic.importer.util.FileFieldParser.parse(Unknown Source)
	at [email protected]/org.jabref.model.entry.BibEntry.getFiles(Unknown Source)
	at [email protected]/org.jabref.logic.pdf.search.indexing.IndexingTaskManager.updateIndex(Unknown Source)
	at [email protected]/org.jabref.gui.LibraryTab.onDatabaseLoadingSucceed(Unknown Source)
	at [email protected]/org.jabref.gui.util.DefaultTaskExecutor.lambda$getJavaFXTask$4(Unknown Source)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
	at [email protected]/javafx.event.Event.fireEvent(Unknown Source)
	at [email protected]/javafx.concurrent.EventHelper.fireEvent(Unknown Source)
	at [email protected]/javafx.concurrent.Task.fireEvent(Unknown Source)
	at [email protected]/javafx.concurrent.Task.setState(Unknown Source)
	at [email protected]/javafx.concurrent.Task$TaskCallable.lambda$call$1(Unknown Source)
	at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
	at [email protected]/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
	at [email protected]/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

@HoussemNasri HoussemNasri added [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs component: bib(la)tex labels Mar 2, 2024
@github-project-automation github-project-automation bot moved this to Normal priority in Prioritization Mar 2, 2024
@HoussemNasri
Copy link
Member

Try to add a colon : just before the file path, like this file = {:A:\Zotero\storage...

@HoussemNasri
Copy link
Member

It turns out JabRef has a cleanup action for this case. After selecting all entries, go to the menu bar and select Quality > Cleanup entries. Select Upgrade external PDF/PS links to use the 'File' field, then click OK.

@Siedlerchr
Copy link
Member

Can you please verify that with the newest development version as well?
Refs #9129
The FieldFieldParser needs to probably be adjusted (see the tests as well)=

@siainbuletin
Copy link
Author

@HoussemNasri Just performed the cleanup on this one file, ended up with this string:

image

Please note that I have next to no knowledge of anything related to programming, so I might've done something else along the way. I'm currently trying to migrate from Zotero as it's gotten incredibly sluggish with processing my files and not even my 32gb ram, i9-12th generation pc can run it smoothly. For context, I have a ridiculous bib database (>8k entries)

@Siedlerchr Currently backing up again and installing the latest branch to see what happens.

@ThiloteE
Copy link
Member

ThiloteE commented Mar 2, 2024

Is there a better solution than a cleanup action? Something more automatic?

@Siedlerchr
Copy link
Member

For solving the issue:
0. Prepare a bib entry with such a file link

  1. Add a new test case for
    private static Stream<Arguments> stringsToParseTest() throws Exception {
  2. Adjust the logic of the FileFieldParser

@HoussemNasri
Copy link
Member

Just performed the cleanup on this one file, ended up with this string:

Yeah, I just performed that on a Windows machine and got the same result. It seems JabRef is not dealing well with backslashes in the file path. It worked when I used double backslashes instead of one.

Can you please verify that with the newest development version as well?

I reproduced it on the development version too.

@koppor
Copy link
Member

koppor commented Mar 4, 2024

This refs #10871.

@siainbuletin How did you get the content in the file field? Did you add the path manually?

@siainbuletin
Copy link
Author

@koppor No, the initial path which wouldn't open is just what is set up by the Better BibLaTeX export function in Zotero. The second is what I got when I ran Cleanup entries, as @HoussemNasri told me to. I didn't tinker with anything manually.

@HoussemNasri
Copy link
Member

HoussemNasri commented Mar 5, 2024

Makes sense, I just tried the default Zotero export function and it has double backslashes and uses the same file field format as jabref which is description:path:filetype. If the description and filetype are not specified it should be :path:

@koppor
Copy link
Member

koppor commented Mar 5, 2024

JabRef has some auto detection magic if the first colon is ommitted and just a path contained. There should be test cades around...

@siainbuletin
Copy link
Author

Any news on this? Possible workarounds?

@Siedlerchr
Copy link
Member

@siainbuletin
I'm taking a look at it. A simple workaround is to add a colon before the file path in the file field

e.g. :A:\Zotero..\.pdf that works

@Siedlerchr
Copy link
Member

@siainbuletin You could try this version now, it should be able to parse the file paths now https://builds.jabref.org/pull/11038/merge

github-merge-queue bot pushed a commit that referenced this issue Mar 18, 2024
* Fixes Zotero file handling for absolute paths

Fixes #10959

* checkstyle mimiimm

* fix changelog

* cannot fix
@github-project-automation github-project-automation bot moved this from Normal priority to Done in Prioritization Mar 18, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 21, 2024
* issue #10993 - feat: added ability to parse preferred-citation field to CffImporter

* issue #10993 - feat: added all fields of JabRef/CITATION.cff to CffImporter

* issue #10993 - feat: rewrote CffExporter to parse Software, Dataset types and authors names correctly

* issue #10993 - feat: added keywords and unknown fields support

* issue #10993 - feat: added round-trip test

* issue #10993 - doc: updated CHANGELOG.md

* Convert RemoveBracesFormatterTest to @ParameterizedTest (#11033)

* Convert to @ParameterizedTest

* Convert to csvsource

---------

Co-authored-by: Carl Christian Snethlage <[email protected]>

* Importing of BibDesk Groups and Linked Files (#10968)

* Add test to check parsing of BibDesk Static Groups

* Add test to check parsing of BibDesk Static Groups

* Change isExpanded attribute to false in expected groups

* remove extra blank line

* Add tests to check parsing of BibDesk Smart and mixed groups

* Add parsing of BibDesk Files

* Attempts at plist

* Now parses bdsk-file and shows it as a file in JabRef

* Add test for parsing a bdsk-file field

* Fix formatting

* Add dd-plist library to documentation

---------

Co-authored-by: Tian0602 <[email protected]>

* Add creation of static JabRef group from a BibDesk file

* Creates an empty ExplicitGroup from BibDesk comment

* Adds citations to new groups
modifies group creations to support multiple groups in the same BibDeskFile

* Fix requested changes
Refactor imports since they did not match with main
Add safety check in addBibDeskGroupEntriesToJabRefGroups

---------

Co-authored-by: Filippa Nilsson <[email protected]>

* Refactor newline to match main branch

Co-authored-by: Filippa Nilsson <[email protected]>

* Add changes to CHANGELOG.md

* Reformat indentation to match previous

* Revert external libraries

Adjust groups serializing

* checkstyle and optional magic

* fix

* fix tests

* fix

* fix dangling do

* better group tree metadata setting

* merge group trees, prevent duplicate group assignment in entry
Add new BibDesk group

Fix IOB for change listeing

* fix tests, and extract constant

* return early

* fixtest and checkstyle

---------

Co-authored-by: Anna Maartensson <[email protected]>
Co-authored-by: Tian0602 <[email protected]>
Co-authored-by: LottaJohnsson <[email protected]>
Co-authored-by: Filippa Nilsson <[email protected]>
Co-authored-by: Filippa Nilsson <[email protected]>
Co-authored-by: Oliver Kopp <[email protected]>
Co-authored-by: Siedlerchr <[email protected]>

* Speed up failure reporting (#11030)

* Fixes Zotero file handling for absolute paths (#11038)

* Fixes Zotero file handling for absolute paths

Fixes #10959

* checkstyle mimiimm

* fix changelog

* cannot fix

* Change copy-paste function to handle string constants (follow up PR) (#11037)

* [Copy] Include string constants in copy (#11)

Signed-off-by: Anders Blomqvist <[email protected]>

* [Copy] New method for serializing string constants (#12)

Signed-off-by: Anders Blomqvist <[email protected]>

* Add a sanity check for null for clipboard content

Currenlty, the clipboard content can be null since the database
does not seem to be updating. This is a sanity check to prevent
the program from adding null to the clipboard.

Link to DD2480-Group1#13

* [Fix] Add parsed serilization when save settings

When loading from existing files or libraries, the parser will set
the serilization of the string constant to the correct value. However,
when editing via the GUI, the serilization was not set and a new
string constant list will be created without the serilization.
This result in the serilization being null and when copying with
the clipboard.

Link to DD2480-Group1#13

* feat: import string constants when pasting #9

Add functionality to import string constants in the paste function

Should add functionality to handle colliding string constants.
Should also check that the constants are valid using the
ConstantsItemModel class.

* feat: Add string constant validity checker and dialog messages #9

Check that a pasted string constant is valid using the
ConstantsItemModel class.

Add diagnostic messages notifying users when adding a string constant
fails while pasting.

* [Copy] Copy referenced constant strings to clipboard  (#16)

* feat: Add parsed serialized string when cloning
* feat: Add sanity check for null in ClipBoardManager
* closes #15

* feat: new unit tests

Add 4 new unit tests, testing the new features added for issue-10872. Specifically the tests are for the `storeSettings` method in the ConstantsPropertiesViewModel.java, and `setContent` in the ClipBaordManager.java.

Closes #6

* Update CHANGELOG with copy and paste function

* Fix Checkstyle failing by reformat the code

* Fix OpenRewrite failing by running rewriteRun

* Refactor by extract methods in setContent

* collet failures

* changelog and use os.newline

* checkstyle

* use real bibentrytypes manager

* Fix CHANGELOG.md

* Swap if branches

* Code cleanup

* Use List for getUsedStringValues

* Fix submodule

* Collection is better

* Fix csl-styles

* Remove empty line

* Group BibTeX string l10n together

---------

Signed-off-by: Anders Blomqvist <[email protected]>
Co-authored-by: Anders Blomqvist <[email protected]>
Co-authored-by: ZOU Hetai <[email protected]>
Co-authored-by: Hannes Stig <[email protected]>
Co-authored-by: Elliot <[email protected]>
Co-authored-by: Oliver Kopp <[email protected]>

* Bump gittools/actions from 0.13.4 to 1.1.1 (#11039)

Bumps [gittools/actions](https://github.com/gittools/actions) from 0.13.4 to 1.1.1.
- [Release notes](https://github.com/gittools/actions/releases)
- [Commits](GitTools/actions@v0.13.4...v1.1.1)

---
updated-dependencies:
- dependency-name: gittools/actions
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump com.googlecode.plist:dd-plist from 1.23 to 1.28 (#11040)

Bumps [com.googlecode.plist:dd-plist](https://github.com/3breadt/dd-plist) from 1.23 to 1.28.
- [Release notes](https://github.com/3breadt/dd-plist/releases)
- [Commits](3breadt/dd-plist@dd-plist-1.23...v1.28.0)

---
updated-dependencies:
- dependency-name: com.googlecode.plist:dd-plist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump org.apache.pdfbox:xmpbox from 3.0.1 to 3.0.2 (#11041)

Bumps org.apache.pdfbox:xmpbox from 3.0.1 to 3.0.2.

---
updated-dependencies:
- dependency-name: org.apache.pdfbox:xmpbox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump com.dlsc.gemsfx:gemsfx from 2.2.0 to 2.4.0 (#11044)

Bumps [com.dlsc.gemsfx:gemsfx](https://github.com/dlsc-software-consulting-gmbh/GemsFX) from 2.2.0 to 2.4.0.
- [Release notes](https://github.com/dlsc-software-consulting-gmbh/GemsFX/releases)
- [Changelog](https://github.com/dlsc-software-consulting-gmbh/GemsFX/blob/master/CHANGELOG.md)
- [Commits](dlsc-software-consulting-gmbh/GemsFX@v2.2.0...v2.4.0)

---
updated-dependencies:
- dependency-name: com.dlsc.gemsfx:gemsfx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump org.apache.pdfbox:fontbox from 3.0.1 to 3.0.2 (#11042)

Bumps org.apache.pdfbox:fontbox from 3.0.1 to 3.0.2.

---
updated-dependencies:
- dependency-name: org.apache.pdfbox:fontbox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Keep enclosing braces of authors (#11034)

* Add test cases

* Add test cases

* Keep braces for last part

* Refine method description

* Adapt test to new braces keeping

* Add CHANGELOG.md entry

* Adapt tests

* More edge cases

* Minor code beautification

* Simplify code

* Fix braces removing

* Extract static fields, refactor code

* Fix removal of {} for export

* Re-add Objects.requireNonNull

* Fix typo

* Re-add NPE throwing

* Rename to modern terms

* Consistent initialization

* Improve citation relations (#11016)

* Collect DOI and publication type from semantich scholar to be able to expand the information of the new entries later by search through DOI

* Include abstract in the request. This lets the GUI show the abstract since that was implemented already.
Refactor api request string since most of it is shared

* Add button to open the relation paper's DOI URL.
Fix DOI for some ArXiv entries.

* Don't show the open link button if there is no link to open.

* Make field value null error a bit more useful

* Include SemanticScholar url in the request and use it as the URL field.

* Add changes to changelog

* Change tooltip text to an existing, more informative one

* Run rewriter to fix pull request

* improve url optional handling

---------

Co-authored-by: Siedlerchr <[email protected]>

* issue #10993 - doc: updated CHANGELOG.md

* fix: fixed unit tests not passing due to name changes in Author interface (#10995)

* feat: changed CFFExporter to use YAML library snakeyaml instead (#10995)

* feat: added support for references and ALL possible CFF fields in importer (#10995)

* fix: added requested changes (#10995)

+ updated CHANGELOG.md
+ removed useless comments
+ refactored both CffImporter and CffExporter to use more specific methods
+ used a BiMap to avoid repeating mappings between CffImporter and CffExporter
+ copied entryMap in exporter to avoid side-effects

* fix: task rewriteDryRun fixed to pass by removing test in BibEntryTest

* refactor: deleted useless methods in CffImporter (#10995)

* doc: added decision MADR document for cff export (#10995)

* feat: add a cites or related relationship between imported entries in CffImporter (#10995)

* doc: updated MADR decision document for cff export to pass markdownlint (#10995)

* fix: fixed round-trip test to use mock citatioKeyPatternPreferences correctly (#10995)

* fix: fixed MADR document for CFF export decision to pass Jekyll CI check (#10995)

* fix: fixed requested changes (#10995)

+ fixed typo in CHANGELOG.md
+ tested multiline abstract in CFFImporter

* feat: finished CFFExporter logic and crafted working round-trip test (#10995)

* fix: fixed typos in MADR decision doc for CFF export and refactore ImportFormatReader signature (#10995)

* Some code beautification

* Use existing method getEntryLinkList

* Use getEntryLinkList

* Use JabRef's Date class for parsing

---------

Signed-off-by: Anders Blomqvist <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Oliver Kopp <[email protected]>
Co-authored-by: Carl Christian Snethlage <[email protected]>
Co-authored-by: Emil Hultcrantz <[email protected]>
Co-authored-by: Anna Maartensson <[email protected]>
Co-authored-by: Tian0602 <[email protected]>
Co-authored-by: LottaJohnsson <[email protected]>
Co-authored-by: Filippa Nilsson <[email protected]>
Co-authored-by: Filippa Nilsson <[email protected]>
Co-authored-by: Siedlerchr <[email protected]>
Co-authored-by: Anders Blomqvist <[email protected]>
Co-authored-by: ZOU Hetai <[email protected]>
Co-authored-by: Hannes Stig <[email protected]>
Co-authored-by: Elliot <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Roc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: bib(la)tex component: external-files [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants