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

Making paths of linked files relative breaks urls #5861

Closed
1 task done
systemoperator opened this issue Jan 22, 2020 · 4 comments · Fixed by #5879
Closed
1 task done

Making paths of linked files relative breaks urls #5861

systemoperator opened this issue Jan 22, 2020 · 4 comments · Fixed by #5879

Comments

@systemoperator
Copy link
Contributor

systemoperator commented Jan 22, 2020

I am using the latest JabRef 5 master build:
JabRef-5.0-portable_linux.tar.gz
JabRef 5.0-beta.360--2020-01-21--7ddfd9f
Linux 4.4.0-171-generic amd64
Java 13.0.2
on Ubuntu 16.04
biblatexmode enabled

Steps to reproduce the behavior:

  1. Create a reference which contains, among others, the following line:
file = {Full Text PDF:https\://www.jair.org/index.php/jair/article/download/11675/26513:application/pdf;Snapshot:https\://www.jair.org/index.php/jair/article/view/11675:text/html},
  1. Save library.
  2. Select the newly created reference.
  3. Click on "Quality" > "Clean up entries", only tick "Make paths of linked files relative (if possible)" and click "OK".
  4. Now the value of the "file" field has changed to the following:
file = {Full Text PDF:https\:/www.jair.org/index.php/jair/article/download/11675/26513:application/pdf;Snapshot:https\:/www.jair.org/index.php/jair/article/view/11675:text/html},

So both urls are broken now and cannot be used any more.

@systemoperator systemoperator changed the title Making paths of linked files relative breaks urls. Making paths of linked files relative breaks urls Jan 22, 2020
@Siedlerchr
Copy link
Member

Olay, so the cleaning changed the type to URL. But the links still work.
I don't see any problem with this

@systemoperator
Copy link
Contributor Author

systemoperator commented Jan 23, 2020

In my opinion, cleaning up entries should not mess with web urls. In the end, the value changes from
https://www.jair.org/index.php/jair/article/download/11675/26513
to
https:/www.jair.org/index.php/jair/article/download/11675/26513.

Furthermore, malformed urls as the one shown below result in different other problems in JabRef:

Given a reference which e.g. contains, among others, the following line:

file = {IEEE Xplore Full Text PDF:https\://ieeexplore.ieee.org/ielx7/8938397/8946120/08946277.pdf?tp=\&arnumber=8946277\&isnumber=8946120\&ref=:application/pdf;IEEE Xplore Abstract Record:https\://ieeexplore.ieee.org/document/8946277:text/html}

I performed a cleanup on this reference. This results in:

file = {IEEE Xplore Full Text PDF:https\:/ieeexplore.ieee.org/ielx7/8938397/8946120/08946277.pdf?tp=\&arnumber=8946277\&isnumber=8946120\&ref=:application/pdf;IEEE Xplore Abstract Record:https\:/ieeexplore.ieee.org/document/8946277:text/html}

When I then select this reference, where the urls are malformed now, and I switch to the tab "General" in the entry editor then sometimes several or at least one exception occurs, stating:

Uncaught excetion occured in Thread[JavaFX Application Thread,5,main]

protocol = https host = null

image

Full stacktrace:

java.lang.IllegalArgumentException: protocol = https host = null
	at java.base/sun.net.spi.DefaultProxySelector.select(Unknown Source)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
	at java.base/java.net.URL.openStream(Unknown Source)
	at org.jabref/org.jabref.model.util.FileHelper.getFileExtension(Unknown Source)
	at org.jabref/org.jabref.logic.externalfiles.LinkedFileHandler.getSuggestedFileName(Unknown Source)
	at org.jabref/org.jabref.gui.fieldeditors.LinkedFileViewModel.isGeneratedNameSameAsOriginal(Unknown Source)
	at org.jabref/org.jabref.gui.fieldeditors.LinkedFilesEditor.createContextMenuForFile(Unknown Source)
	at org.jabref/org.jabref.gui.util.ViewModelListCellFactory$1.updateItem(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.ListCell.updateItem(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.ListCell.indexChanged(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.IndexedCell.updateIndex(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.skin.VirtualFlow.setCellIndex(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.skin.VirtualFlow.addTrailingCells(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.skin.VirtualFlow.layoutChildren(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Parent.layout(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Scene.doLayoutPass(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Scene$ScenePulseListener.pulse(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.Toolkit.runPulse(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.Toolkit.firePulse(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(Unknown Source)
	at org.jabref.merged.module/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
	at org.jabref.merged.module/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at org.jabref.merged.module/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Additionally, the tab "General" breaks, as it does not get rendered completely anymore.

Furthermore, when I subsequently switch to another reference and switch back to the previously cleaned up reference, then no content of the tab "General" can be rendered anymore.

image

Sometimes the whole entry editor breaks, so that no tabs and no content can be shown. Every now and then it also happens that the entry editor's "General" tab cannot be rendered anymore for other references in this library, which have not been cleaned up. Sometimes the library's search functionality breaks as well for this library due to the malformed urls.

Occationally, the whole library must be closed so that JabRef recovers.

Actually, I started digging into this issue with the malformed urls due to the fact, that a lot exceptions and problems occured.

systemoperator pushed a commit to systemoperator/jabref that referenced this issue Jan 27, 2020
Description:
- Cleanup entries: "Make paths of linked files relative (if possible)" broke web URLs and resulted in various other issues subsequently. This PR fixes this issue.
It has been tested for local files and web urls.
tobiasdiez pushed a commit that referenced this issue Jan 29, 2020
…ched anymore) (#5879)

* Fixes #5861
Description:
- Cleanup entries: "Make paths of linked files relative (if possible)" broke web URLs and resulted in various other issues subsequently. This PR fixes this issue.
It has been tested for local files and web urls.

* changelog updated

* refactoring: use existing method isOnlineLink() for checking whether a file link is an online link; improving isOnlineLink()
@tobiasdiez
Copy link
Member

Thanks to you 😄 this should be fixed in the latest development version. Could you please check the build from http://builds.jabref.org/master/. Thanks! Please remember to make a backup of your library before trying-out this version.

@systemoperator
Copy link
Contributor Author

Build checked, it works. :)

koppor pushed a commit that referenced this issue Jan 30, 2020
…ched anymore) (#5879)

* Fixes #5861
Description:
- Cleanup entries: "Make paths of linked files relative (if possible)" broke web URLs and resulted in various other issues subsequently. This PR fixes this issue.
It has been tested for local files and web urls.

* changelog updated

* refactoring: use existing method isOnlineLink() for checking whether a file link is an online link; improving isOnlineLink()
Siedlerchr added a commit that referenced this issue Feb 5, 2020
* Fixes making paths of linked files relative (web urls will not be touched anymore) (#5879)

* Fixes #5861
Description:
- Cleanup entries: "Make paths of linked files relative (if possible)" broke web URLs and resulted in various other issues subsequently. This PR fixes this issue.
It has been tested for local files and web urls.

* changelog updated

* refactoring: use existing method isOnlineLink() for checking whether a file link is an online link; improving isOnlineLink()

* Replace link to Workspace set-up with new one (#5896)

As the current link just pointed to a page with another link, I'd propose to directly put that second link.

* update to 13.0.2

Co-authored-by: systemoperator <3658393+systemoperator@users.noreply.github.com>
Co-authored-by: Thomas F. Duellmann <duelle@users.noreply.github.com>
koppor pushed a commit that referenced this issue Feb 15, 2022
eb97405 Create frattura-ed-integrita-strutturale-fracture-and-structural-inte… (#5877)
b33ebfc make journal names title case (#5900)
1c7ecf2 Update uclouvain-centre-charles-de-visscher-pour-le-droit-internation… (#5901)
1a2ea12 Create trinity-college-dublin-zoology-botany-environmental-sciences-h… (#5893)
6bd742c Update harvard-anglia-ruskin-university.csl (#5840)
bc8f258 Update chicago-author-date.csl (#5836)
80aded6 Fix missing prefix for URL field (#5894)
b850a0d Update american-society-of-civil-engineers.csl (#5891)
94c1cb3 Update deutsche-gesellschaft-fur-psychologie.csl (#5861)
f66f384 Update universite-cheikh-anta-diop-faculte-de-medecine-de-pharmacie-et-dodontologie.csl (#5863)
82cf786 Update and rename acta-psychiatrica-scandinavica.csl to dependent/acta-psychiatrica-scandinavica.csl (#5879)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: eb97405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants