Jabref: Changing entry type does not always work when biblatex source is not shown

Created on 2 Feb 2020  路  10Comments  路  Source: JabRef/jabref

I am using the latest JabRef 5 master build:
Java 13.0.2
on Ubuntu 16.04

The value of the entry type field for an entry in the main table is not updating when changing its type by using the dropdown menu of the entry editor. To differentiate this from issue #5905, one can assume, that in the entry editor the tab "biblatex source" is not/never active.

Steps to reproduce the behavior:

  1. Double click an entry in the main table (with e.g. entry type "Article")
  2. Change entry type via the dropdown menu to a different entry type (e.g. entry type "Misc")
  3. Do "whatever you want", but don't open the tab "biblatex source" in the entry editor.

_Observation:_ Commonly, the entry type will not change in the main table, even if shortly selecting a different entry in the main table and reselecting the edited one. Sometimes temporarily switching to a different opened library helps, but not always.

Contrarily, other fields in the main table will be updated immediately, when their values get changed.


Subsequent observation (now allows viewing the tab "biblatex source"):

  1. Perform steps 1. and 2. as above.
  2. Save library with CTRL+S.
  3. Switch to "biblatex source"

_Observation:_ The library has been modifed (indicated with the star symbol "*"), although no change was conduted.

For both cases, I assume it could be some reference problem.

maintable bug 馃悰 ui

Most helpful comment

Thanks for the hint, adding a check for the entry type in that binding works

All 10 comments

It's only a display issue: if you change the entry type, save and reload the database the change is correctly reflected.

@tobiasdiez On the one hand, I wanted to address the display issues (in the main table and in the tab "biblatex source", where in the source the entry type sometimes does not get updated), on the other hand, I think it is not only a display issue:

Consider the following:

_Prerequisite:_ Make sure, that in Options -> Preferences -> Entry editor -> "Show BibTeX source by default" is NOT ticked.

  1. Double click or click an entry in the main table (with e.g. entry type "Article") to see its entry editor
  2. Change entry type via the dropdown menu to a different entry type (e.g. entry type "Misc")
  3. Save library with CTRL+S.
  4. Switch to "biblatex source"
    _Observation:_ The library shows that it has been modifed (indicated with the star symbol "*"), although no change was conducted after saving it. Furthermore, to be precise, the tab "biblatex source" still shows the original entry type (so not the new one!) in the source text. _If this is not ALL the case switch to a tab different than "biblatex source" (e.g. tab "Required fields") and again start from step 2. (using now another, different entry type, so that you can better differentiate them). [Usually, the first "round" is ok, but any further round not. This obviously depends on what one has already done before performing this procedure.]_
  5. Optional: Switch to a different tab than "biblatex source"
  6. Again save library with CTRL+S. (-> The modified indicator (*) vanishes.)
  7. Reload library (by closing and reopening it)

_Observation:_ The performed change (namely changing the entry type) has been overwritten to the previous entry type.

This could indicate a reference issue as well. From my perspective, it seems, that the tab "biblatex source" still references to the previous entry (or the changes simply have not been written to the tab "biblatex source") and it "writes back" the contained values, since it is (and must be) quite sensitive to changes.

@calixtus you recently fixed a bug and reused that code editor component. Maybe this is the issue now for the incorrect reference?

That would explain why we did not reuse the control, but recreated every time

Im going to investigate this tomorrow.

I took a look into the code, it's two bugs: one thing is about the source tab, it easily fixed by adding an InvalidationListener to the typeProperty (fix incoming for issue #5905 ).

The other one, this here, is about displaying the changed entry type in the main table.

This bug here could be a simply consequence of the fact that
https://github.com/JabRef/jabref/blob/master/src/main/java/org/jabref/model/entry/BibEntry.java#L940
does not contain type. Thus, changes of the type do not trigger change events (and thus the main table is not updated).

I tried the simple fix idea from @tobiasdiez and added entryType to the observables. However, this has only an impact on the PreviewViewer. The observables are only used in the PrevieViewer.
However, I think we need to have a simliar class like FieldCoumn which handles the entry type or maybe we can extend the fieldColumn. I could not find anything related to the entry type in the MainTable. So I guess this explains it. Because entry type is not a field, it's not updated

Thanks for the hint, adding a check for the entry type in that binding works

I can confirm, that all problems mentioned within this issue are fixed with this commit. :) One very related issue (where I hoped this would fix it as well) is still open: #5905

Was this page helpful?
0 / 5 - 0 ratings

Related issues

caugner picture caugner  路  3Comments

LinusDietz picture LinusDietz  路  3Comments

lenhard picture lenhard  路  4Comments

oscargus picture oscargus  路  3Comments

simonharrer picture simonharrer  路  3Comments