jabref
                                
                                 jabref copied to clipboard
                                
                                    jabref copied to clipboard
                            
                            
                            
                        Importing bib file shows message that it's importing "unknown format"
JabRef version
Latest development branch build (please note build date below)
Operating system
Windows
Details on version and operating system
Windows 11
Checked with the latest development build (copy version output from About dialog)
- [X] I made a backup of my libraries before testing the latest development version.
- [X] I have tested the latest development version and the problem persists
Steps to reproduce the behaviour
- Open any bib file
- File > Import > Import into current library
- Without changing the file filter of the open dialog,
- Choose any other bib file (the same bib file also reproduces the error)
- Notice that a message pops up saying that it's importing the given file as "unknown format"
Looking at the code in org/jabref/gui/importer/ImportCommand.java, it seems that the import code is using the selected file filter in the dialog to choose the importing class, but if the filter is set to "Any file (.)" then it gets confused somehow.
I feel like the filter could be used as a hint, the same way that the file extension is usually used as a hint, but saying that the format is unknown when it's clearly a bib file is confusing.
Edit: upon further testing, this has ramifications. It seems that if the file format is "unknown", groups from the imported file won't be imported into the library. Steps to reproduce this:
- Open any bib file
- File > Import > Import into current library
- Without changing the file filter of the open dialog,
- Choose another bib file saved from jabref that has groups and entries with groups assigned
- Notice the popup about "unknown format"
- Import everything in that file
- Save the file, close it, and open it again
- Notice that the groups were not imported
as opposed to using the "right" file type filter:
- Open any bib file
- File > Import > Import into current library
- Choose *.bib as the file type filter in the dialog
- Choose another bib file saved from jabref that has groups and entries with groups assigned
- Notice the popup about "importing from bibtex"
- Import everything in that file
- Save the file, close it, and open it again (apparently the groups list is not updated after importing, only after reloading)
- Notice that the groups were properly imported
Appendix
@ror3d Thank you for looking at the code. I think, it will be propagate the kind of import. Let's see how it will work out for you :) - We are reachable on Skype BTW. You can ping us there (find me with "koppor")
Actually, upon further testing, this also causes problems because it then doesn't import groups. I'll update the issue.
About reaching out, I appreciate it but I only have very little time that I can put into working on these, so I hope with these details someone else can work on it and fix this.
About reaching out, I appreciate it but I only have very little time that I can put into working on these, so I hope with these details someone else can work on it and fix this.
It's a procrastination project for all of us 🤣🤣