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

jabref automatically deletes entries showing wrong syntax #9668

Closed
2 tasks done
Processeer opened this issue Mar 13, 2023 · 8 comments
Closed
2 tasks done

jabref automatically deletes entries showing wrong syntax #9668

Processeer opened this issue Mar 13, 2023 · 8 comments

Comments

@Processeer
Copy link

Processeer commented Mar 13, 2023

JabRef version

5.9 (latest release)

Operating system

Windows

Details on version and operating system

Windows 11 Pro - 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

  1. I created a field "library"
  2. I used the field to controll where the pdfs are saved in substructures in Preferences/LinkedFiles/FileDirectoryPattern
  3. I inserted in the filed library "Tagungen\2013\KWTK45" using backslashes instead of slashes
  4. JabRef correctly moved the file into the folder, even created the subfolder
  5. instantly after saving the message appeared "...modified by onother prgram" saying entry was deleted

It took me a wile to check that the backslashes lead to this automatik removal of the entire entry. I would expect an error message or an automatic reeplacement into slashes.
2023-03-134

Appendix

@InProceedings{Wen2013,
  author           = {Tao Wen},
  booktitle        = {45. Kraftwerkstechnisches Kolloquium},
  library          = {Tagungen\2013\KWTK45\},
  title            = {Zünd- Und Abbrandverhalten Von Staubförmigen Brennstoffen},
  year             = {2013},
  comment          = {978-3-944310-04-06},
  creationdate     = {2023-03-13T13:09:59},
  file             = {:Tagungen/2013/KWTK45/Wen2013 - Zünd Und Abbrandverhalten Von Staubförmigen Brennstoffen.pdf:PDF},
  keywords         = {zündverzug, kohle, braunkohle, lausitz, zündofen, experiment, verzögerung, partikeldurchmesser, zündhyperbel, holzhackschnitzel, torf, staub, steinkohle, getreidestaub, brennstofffeuchte, biomasse, fossile, flüchtige, volatile, FIELD-Rohr, drop-tube, model, vergleich, berechnung,},
  modificationdate = {2023-03-13T13:17:17},
  owner            = {JOJ},
  url              = {https://fis.tu-dresden.de/portal/de/publications/zund-und-abbrandverhalten-von-staubfoermigen-brennstoffen(2f9dd517-794a-4cf5-9897-bc9eb6f125c6).html},
}
@koppor
Copy link
Member

koppor commented Mar 17, 2023

Thank you for reporting this!

The tricky thing is that the character \ is used as LaTeX command prefix. Moreover, it is used as escape character if one wants to have a closing brace literally in BibTeX. Example:

@misc{test,
  comment={The set \{\} denotes the empty set, too},
}

In your context, this surely makes no sence to interpret the backslash as escaping character. I am working on an improved parser.

Workaround: Until there is a fix, please replace \}, by }, in your BibTeX code.

@koppor
Copy link
Member

koppor commented Mar 17, 2023

Other thing, I never saw library in BibTeX. @Processeer Is this the way your institution puts the file path into a BibTeX entry? (This somehow refs #98).

JabRef itself offers another sophisticated method to denote file directories: https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#directories-for-files. @Processeer

@koppor
Copy link
Member

koppor commented Mar 17, 2023

Code comment: This is caused by

parserResult.addWarning(Localization.lang("Error occurred when parsing entry") + ": '" + ex.getMessage()
. I wonder why the parser result is not displayed to the user. Think, we need to work on that (if JabRef reads a file from disk). Could be more complicated though.

@koppor
Copy link
Member

koppor commented Mar 20, 2023

Note that JabRef "simply" removed all entries following the inserted ones.

Example:

@Article{,
  author   = {test\},
  journal  = {Sci China Inf Sci},
  title    = {a\b\c\},
  year     = {2022},
  month    = sep,
  annote   = {lala},
  fjournal = {IEEE Transactions on Medical Imaging},
}

@Article{ostgaard2002,
  title = {energy},
  month = sep,
  year  = {2012},
}

ostgaard2002 was also removed, because the closing brace of the first entry was not parsed "as intended" and thus the next @Article was treated as belonging to the first article.

Maybe, we need to refine our parsing logic to "terminate" parsing the current entry and start parsing a new entry if @Article or a similar token is found.

@Processeer
Copy link
Author

Processeer commented Mar 21, 2023 via email

@koppor
Copy link
Member

koppor commented Mar 22, 2023

... we used this field exactly for this reason. The challenge was to be able to sort the files according to its "library" in a specific folder or subfolder on the hard drive.

JabRef offers the grouping feature. They can be hierarchical, too. I think, there should be work done to have groups synchronized with the file directories. I opened an issue at koppor#638 to refine the requirements. Please comment there if you have more ideas.

Thats the way it hapened. I know, it might be a little far of the normal usage. I just wanted to report this behaviour.

We really thank you for this, because you surely are not the first one hitting that behavior - and would not have been the last one.

I know whats behind it now, so you can decide If its important enough to be tackled.

We already tackled it at #9677. The build at https://builds.jabref.org/main/ contains the fix and should work.

@Siedlerchr
Copy link
Member

@koppor with File Directory Pattern you can also use the group field

@koppor
Copy link
Member

koppor commented Apr 10, 2023

Since this is fixed in main, I close this issue. Plrease reopen if the issue still persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants