jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Saving custom entry type with same name overwrites existing entry type

Open ThiloteE opened this issue 9 months ago • 14 comments

JabRef version

6.0-alpha.4

Operating system

Windows

Details on version and operating system

No response

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

Follow https://docs.jabref.org/setup/customentrytypes

How to reproduce

  1. Type "Book" and press the + button Image
  2. Notice there are now two entrytypes with the name of "Book".
  3. Press "save"

Result:

The custom entry type "Book" overwrites the standardtype "Book", hence instead of two books, there will only be one book and all fields will be gone. Image

Solution

At the very least, if users type in the field for custom entry types, they should not be able to press the + button, if this entrytype already exists. There are should be a tiny tooltip that tells the user duplicate entry types are not supported. Something along the lines of "It is not possible to have two entry types with the same name".

I am not quite sure yet, what implications this has for migrating from old versions of JabRef to new Versions of JabRef with updated entrytypes or even what happens, if users with custom entry types open a library with unique entry types.

Appendix

...

Log File
Paste an excerpt of your log file here

ThiloteE avatar Feb 09 '26 21:02 ThiloteE

Thanks for outlining the proposed solution.

I agree that disabling the ā€œ+ā€ button and showing a clear tooltip would improve the user experience. At the same time, it seems important to also guard against overwriting at the core level (where custom entry types are stored), so duplicates are prevented even outside the UI (e.g., imports or migrations).

I’m thinking of:

  • Ensuring uniqueness checks when saving custom entry types (case-insensitive / normalized comparison)
  • Adding UI feedback (disabled button + message) when a conflict is detected

Does this align with the expected behavior, or would you prefer a UI-only solution for now?

anosvoldi883 avatar Feb 10 '26 17:02 anosvoldi883

The custom entry type "Book" overwrites the standardtype "Book", hence instead of two books, t

Works as discussed several times before you joined.

Please search issues for "customized entry types", "standard types".

There are many discussions.

We need to write that down at docs/requirements to make the knowledge more accessible.


One reason is that ppl want to customize the entry type to fields required by a certain BST file.

koppor avatar Feb 10 '26 17:02 koppor

@koppor You can modify an existing entry type and delete/remove fields. That works. But we cannot have two entry types with the same name, nor fields

Siedlerchr avatar Feb 10 '26 18:02 Siedlerchr

+1 for

they should not be able to press the + button, if this entrytype already exists.

koppor avatar Feb 10 '26 18:02 koppor

Ensuring uniqueness checks when saving custom entry types

Not required as addition is not possible

koppor avatar Feb 10 '26 18:02 koppor

This probably refs https://github.com/JabRef/jabref/pull/11230

koppor avatar Feb 10 '26 18:02 koppor

Actually, the most elegant (UI) solution I can think of would be:

  • [x] implement a "search while you type" and show the existing entrytypes (e.g. "Book") in a dropdown during the search. If a duplicate entrytype (= same name as an existing entry type) is entered and the user presses enter or the + button it will automatically select and switch the table on the right (where users can edit the fields) to the already existing entrytype.

Good enough solution (for now):

  • [ ] they should not be able to press the + button, if this entrytype already exists.

ThiloteE avatar Feb 10 '26 18:02 ThiloteE

/assign-me

pluto-han avatar Feb 10 '26 21:02 pluto-han

šŸ‘‹ Hey @pluto-han, thank you for your interest in this issue! šŸŽ‰

We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly.

For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.

In case you encounter failing tests during development, please check our developer FAQs!

Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.

Happy coding! šŸš€

jabref-machine avatar Feb 10 '26 21:02 jabref-machine

  • mplement a "search while you type" and show the existing entrytypes (e.g. "Book") in a dropdown during the search

Does the user really expect existing types when asked for a new type?

I would propose:

  • Label of button "+" is "Add" if the entry type is not in the list
  • Label of button "+" is "Modify" if entry type is in the list

"Modify" just selects the existing type, "Add" creates a new one.

koppor avatar Feb 11 '26 08:02 koppor

Hi! I am working on this in PR #15116. I've hit a small bot error (422 validation) during the PR check regarding assignees, but the code is ready for a look!

janhlavati avatar Feb 15 '26 00:02 janhlavati

hi @janhlavati , i was assigned to this issue first and have already submitted a pr. Thx for the work tho^^

pluto-han avatar Feb 15 '26 00:02 pluto-han

It seems that @janhlavati AI cannot fuliy understand "good open source behavior". 😄

koppor avatar Feb 15 '26 06:02 koppor

We think that this issue was fixed. Please head to https://builds.jabref.org/main to download a development build and try it out.

For any feedback, add a comment to the pull request at https://github.com/JabRef/jabref/pull/15107.

github-actions[bot] avatar Feb 16 '26 21:02 github-actions[bot]