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

Duplicate fields assigned to entry types #8194

Closed
2 tasks done
HoussemNasri opened this issue Oct 26, 2021 · 8 comments · Fixed by #8391
Closed
2 tasks done

Duplicate fields assigned to entry types #8194

HoussemNasri opened this issue Oct 26, 2021 · 8 comments · Fixed by #8391
Labels
bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects

Comments

@HoussemNasri
Copy link
Member

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

JabRef 100.0.0 Windows 10 10.0 amd64 Java 16 JavaFX 17.0.0.1+1

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. Select Options > Customize entry types
  2. Select any entry type
  3. Add a field that is already added to that entry type
  4. It gets added normally (BAD)

Expected: We should ignore the user request or display a warning to tell him that he is trying to add a duplicate field

  • Please note that after restarting CustomizeEntryTypeView the duplicate will be gone

Appendix

No response

@Siedlerchr Siedlerchr added the bug Confirmed bugs or reports that are very likely to be bugs label Oct 27, 2021
@Siedlerchr Siedlerchr added this to Normal priority in Bugs via automation Oct 27, 2021
@Siedlerchr Siedlerchr added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Nov 14, 2021
@wujastyk
Copy link

Footnote: this is probably a Biblatex issue not a Jabref one, but I would often like to be able to add multiple URLs or eprint fields. For example, when recording a multi-volume book where the vols are at different URLs at archive.org. Happens quite frequently

@dimitrisdimos00
Copy link
Contributor

Hello! I would like to take a look at this. From what I understand, we want a warning popup to be shown to the user when he tries to add an existing field. Is that correct? Thank you.

@wujastyk
Copy link

wujastyk commented Jan 4, 2022

I think a warning is a good idea.
But if one wants multiple fields for, say, multiple ISBNs or multiple URLs, it should be somehow possible. The output in such cases could, perhaps, be concatenated with commas or something.

@Siedlerchr
Copy link
Member

@wujastyk It's not possible to have the same field twice in bibtex/biblatex with the same name. The spec does not allow this. Think of it like a Dictionary with key-value mapping. More details here http:https://tug.ctan.org/info/bibtex/tamethebeast/ttb_en.pdf

Show a warning with "Warning: You added field X twice. Only one will be kept."

Codwise the dialog is located here https://github.com/JabRef/jabref/tree/main/src/main/java/org/jabref/gui/customentrytypes

@dimitrisdimos00
Copy link
Contributor

Thanks for the guidance! I will try this out.

@wujastyk
Copy link

wujastyk commented Jan 4, 2022

@Siedlerchr yes, no, quite. I understand the limitations and features of BibTeX and BibLaTeX.

My thought was that maybe JabRef could repackage multiple-field data into a single output BibTeX field. ISBN is probably insoluble, unless the info was concatenated into a note field. With multiple urls, which I have a lot, perhaps multiple urls could be wrapped in \url{xxx} and concatenated into a note or some other field. But the more I think about this, the more I think it's probably too fiddly and not very good.

@dimitrisdimos00
Copy link
Contributor

dimitrisdimos00 commented Jan 5, 2022

Hello there. I have fixed the issue with the warning and all, however when running gradlew.check inside the jabref folder, these are the test results. Do you know what's the problem? What should I do with them? Thanks in advance.
image
I am ready for the pull request after resolving that.

dimitrisdimos00 added a commit to dimitrisdimos00/jabref that referenced this issue Jan 5, 2022
Changed the method addNewField of class CustomEntryTypeDialogViewModel in order to check if the field already exists. Added DialogService field to class CustomEntryTypeDialogViewModel in order to show warning notification to the user.
fixes JabRef#8194
@Siedlerchr
Copy link
Member

@dimitrisdimos00 You do not reed to run gradlew check locally, when you create a PR the Github Actions CI is executed with the unit tests. If that is green, then it's fine.

If you modify a class that has existing tests, it's of course useful to execute them in your IDE locally. Also, useful is usually the LocalizationConsistencyTest e.g. if you changed/added the L10n.

Otherwise, proceed with your PR so we can review it.

dimitrisdimos00 added a commit to dimitrisdimos00/jabref that referenced this issue Jan 5, 2022
dimitrisdimos00 added a commit to dimitrisdimos00/jabref that referenced this issue Jan 5, 2022
dimitrisdimos00 added a commit to dimitrisdimos00/jabref that referenced this issue Jan 12, 2022
Bugs automation moved this from Normal priority to Done Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Archived in project
Bugs
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants