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

Empty entry in JabRef leads to Error when compiling in LaTeX #8096

Closed
2 tasks done
ThiloteE opened this issue Sep 24, 2021 · 26 comments · Fixed by #8218
Closed
2 tasks done

Empty entry in JabRef leads to Error when compiling in LaTeX #8096

ThiloteE opened this issue Sep 24, 2021 · 26 comments · Fixed by #8218
Labels
good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement

Comments

@ThiloteE
Copy link
Member

JabRef version

5.3 (latest release)

Operating system

Windows

Details on version and operating system

Windows 10, 20H1

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

  • Create a new Entry (because you intend to enter a new entry, BUT THEN YOU CHANGE YOUR MIND AND FORGET DELETING IT)
  • Do not enter any data into the entry; A empty entry.
  • This is how an empty entry looks like in the bib-file:
@Article{,
}

Save your libary > use this file for your latex project > try to compile your latex project with Miktex and Texmaker > Error ensues, which prevents me from completing my latex compilation.

Solution i would like:

  • Give warning or explanation in JabRef that having empty entries in your bib-files could lead to this.
  • Enhance empty entries visually
  • Ask if empty entries should be deleted upon saving (with explanation why)

Appendix

No response

@ThiloteE
Copy link
Member Author

I use biblatex and biber for compilation.

@Siedlerchr Siedlerchr added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Sep 25, 2021
@neha-b2001
Copy link

neha-b2001 commented Oct 6, 2021

Hello, is this issue open to be assigned to someone? If yes, can I work on this issue?

@Siedlerchr
Copy link
Member

@neha-b2001 This issue is free to take! Make sure to follow our contribution guide

@ThiloteE
Copy link
Member Author

ThiloteE commented Oct 6, 2021

There are more than one ways how to deal with this! There is an interesting discussion in #7057 that deals with a similar problem, that is the deletion of an entry in regards to crossref.

e.g.: #7057 (comment)

In addition to the solutions i mentioned in my first post, i became aware of solutions that involve:

  • Preferences
  • Cleanup actions
  • automatic deletion of empty entry upon saving (without warning for user)

@ThiloteE
Copy link
Member Author

ThiloteE commented Oct 6, 2021

Uh i just noticed that automatic deletion of empty entry upon saving might collide with the automatic saving option (this option is not automatically on, but can be enabled under preferences). It might lead to a situation where you want to create an empty entry, then edit that entry, but because automatic saving triggers, the empty entry gets deleted before you can enter data.

@neha-b2001
Copy link

@neha-b2001 This issue is free to take! Make sure to follow our contribution guide

Oh okay 👍
I'll try working on it, then

@ilippert
Copy link
Contributor

I would argue that "Cleanup actions" might be shown to the user (for instance when they close jabref), the cleanup tasks would be shown, and the user given the chance to intervene, otherwise, the tasks would be completed after waiting for 5 secs.
I know this issue is not the right point to suggest this - but I always think of this, when I think about issues just like this issue with the empty entry.

@jiezheng5
Copy link
Contributor

Hi,

I am a cs student, can I work on this issue?
To my understanding, I just need to automatically remove any empty fields user added, correct?

thanks very much

@ThiloteE
Copy link
Member Author

Thank you. Yes, indeed. Please take into account that there are circumstances where it is WANTED to create an empty entry and then to edit that entry. It can't just get deleted instantly one second after creation. There has to be a proper time and place for deleting it. It has to be, when it is clear that the user will not have any need for the empty entry anymore. Above, some possibilities have been mentioned how to deal with this.

Also "article" is just one of the possibly entry types. See here:

image

@ThiloteE
Copy link
Member Author

I usually create an empty entry with the + button in the Jabref UI
image

@Siedlerchr
Copy link
Member

Siedlerchr commented Oct 30, 2021

I think we have an integrity check in place that warns of empty entries. Maybe show that also when closing JabRef?
Needs to be a dialog with the option to ignore it and "do not show this dialog again"

@ilippert
Copy link
Contributor

ilippert commented Oct 30, 2021

Maybe show that also when closing JabRef? Needs to be a dialog with the option to ignore it and "do not show this dialog again"

This is kind of what I was imagining at #8096 (comment). But just to be sure, I guess it will save time in the future if we think of this as part of a wider "interactive closing JabRef procedure". That procedure might encompass the point discusses in this issue, as well as other operations, such as checking for several entries with the same citekeys.
Relevant options for the user might be

  • ignore now
  • repair/delete (i.e. conduct the proposed action)
  • do not ask for this kind of issue again

and still, if the user does not react for, say, 5 seconds, then ignore now would be the default and JabRef closes.

@jiezheng5
Copy link
Contributor

jiezheng5 commented Oct 31, 2021 via email

@ruoyu-qian
Copy link
Contributor

ruoyu-qian commented Nov 8, 2021

Hi, I am a CS student working together with @jiezheng5 on this issue. I had some initial progress but still plan to make some additional changes. I took a look at your contribution guide, and have created a draft pull request. Hope that's okay. I also plan to add some JUnit tests in the next few days. Thanks!!

@ruoyu-qian
Copy link
Contributor

ruoyu-qian commented Nov 8, 2021

Hi, I made some additional changes and added a couple of unit tests. I have submitted the PR for review.

I did see there is one unit test failed:
Test testImportEntries() in org.jabref.logic.importer.fileformat.PdfGrobidImporterTest.
But it seems I would still get this test failing even if I commented out my changes. Any suggestions?

This is also my first time trying to make contribution to an open-sourced project. My apologies in advance if I missed any contribution guide.

@ThiloteE
Copy link
Member Author

Thank you very much everybody, but especially @ruoyu-qian for your contributions :)))
I am very happy. So far, everything works perfectly! 👌

Additional enhancements would be:

  • add checkbox for do not ask for this kind of issue again
  • add tiny ? that explains what an 'empty entry' is. Something like:
    • An empty entry is defined as @entrytype{, }. An example would be: @Article{, }. An empty entry can be found in the library-file or in biblatex source when selecting the empty entry via the entry editor.

@ruoyu-qian
Copy link
Contributor

Thank you for the suggestions! I will try adding them in. One question about

add tiny ? that explains what an 'empty entry' is.

Do we want to include the explanation in the popup confirmation window or were you thinking about somewhere else?

@Siedlerchr
Copy link
Member

I would suggest that we just add a help entry to the help page describing this empty entry. I guess it should be obvious for most users what an empty entry is.

For the Do not ask again, there is a dialog method in the dialogService class

@ThiloteE
Copy link
Member Author

ThiloteE commented Nov 13, 2021

Adding info to the help page is fine too. If i had a choice, i would add it within Jabref because it is easier for the user (no need to search on the web first), but i am not the one that has does the coding, so feel free to do the thing that might go into the right direction and you are confident about being able to handle. :)

Btw. I noticed that by entering the terms empty entry jabref into the ecosia search engine, the first thing that pops up is this very github issue :D

@ruoyu-qian
Copy link
Contributor

ruoyu-qian commented Nov 14, 2021

Sounds good! I will see what I can do. If I would like to make additional changes, do I need to create a new branch and make a new PR considering the previous one has been merged? Or can I make commits to my same branch?

@Siedlerchr
Copy link
Member

You first need to update/sync your fork with the JabRef/Jabref main so that it includes the latest commits. Then you create a new branch and a new PR.

@ruoyu-qian
Copy link
Contributor

Got it. Thanks!!

@koppor
Copy link
Member

koppor commented Nov 14, 2021

Adding info to the help page is fine too. If i had a choice, i would add it within Jabref because it is easier for the user (no need to search on the web first),

JabRef 2.x had the feature to jump from a ? to the help page. We seem to still have it: org.jabref.gui.help.HelpAction#openHelpPage. So it would be a good thing, to keep using it. We should add many more help buttons to JabRef to direct the users to our documentation.

@koppor
Copy link
Member

koppor commented May 12, 2022

@ThiloteE While reviewing the pull requests of this issue, I am asking myself whether JabRef shouldn't just silently delete empty entries. They contain "only" the entry type as information. Otherwise, they would not have been empty. - Why this effort with keeping the entries - and the UI quirks to enable auto-deletion?

@ThiloteE
Copy link
Member Author

ThiloteE commented May 12, 2022

@koppor You might be right. Deleting them silently might be the better approach. Especially if #8768 is taken into account. We would need to wait a while until a fix for 8768 will arrive at JabRef. Back when I created this Issue, I was not aware it would take this much effort to create this pop-up.

Not sure if deleting empty entries silently upon save will lead to problems with shared databases, though. If I remember right, sharing your library with a database creates a lot of save actions. Edit: Silently deleting upon closing JabRef should be fine. Of course this still might lead to awkward behaviour, when multiple people work on the same library, so a notification in the event log that another user triggered the delete might be the way forward :-)

Also, #8645 actually seems to be the real problem...

@ThiloteE
Copy link
Member Author

@LIM0000 pulling you into this, because there was some discussion here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants