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

Not possible to change or create custom fields in "{} biblatex source" tab #8859

Closed
2 tasks done
ThiloteE opened this issue May 29, 2022 · 9 comments
Closed
2 tasks done
Labels
bug Confirmed bugs or reports that are very likely to be bugs entry-editor
Milestone

Comments

@ThiloteE
Copy link
Member

ThiloteE commented May 29, 2022

JabRef version

Latest development branch build (please note build date below)

Operating system

GNU / Linux

Details on version and operating system

JabRef 100.0.0 Linux 5.4.0-113-generic amd64 Java 18.0.1 JavaFX unknown

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. Go to {} biblatex source tab
  2. Try to add a new custom field
    e.g. whatever = {whatevernot},
  3. Switch to a new tab or select another entry in the maintable
  4. Switch back to {} biblatex source tab

What happens:

New custom entry has not remained. It has vanished.

Additional info:

  • It is possible to change whatever is WITHIN a field (withing the curly braces { }).
  • Changing anything OUTSIDE of a field is not possible anymore and will be deleted upon switching. E.g. changing the field title by typing date will lead to vanishing.

Cause:
I tested some recent commits and found it was caused by 7257350

What to do:

Not sure. We have the choice between pest and cholera.

  • Revert: We gain the feature back, but we also got an indexoutofbounds issue.
  • Have commit: Fixes an index out of bounds issue, but we loose the feature.
    • Also it is still possible to create customized fields. Very lengthy workarounds:
      • Fields can be created under options > customize entry types
      • Customized Fields can be edited directly in the library file (via texteditors) and imported into JabRef

Appendix

No response

@ThiloteE
Copy link
Member Author

@LIM0000

@ThiloteE
Copy link
Member Author

To be honest, I think this feature is too important to let go of it because of this index out of bounds. :/ Damn. Welcome back index out of bounds.

@ThiloteE ThiloteE added entry-editor bug Confirmed bugs or reports that are very likely to be bugs labels May 29, 2022
@Siedlerchr Siedlerchr added this to the v5.7 milestone May 29, 2022
@LIM0000
Copy link
Contributor

LIM0000 commented May 29, 2022

Thank you @ThiloteE , I strongly believe it is possible to add the feature and fix the index out of bound issue at the same time.
I will create a PR for this issue soon.

@LIM0000
Copy link
Contributor

LIM0000 commented May 30, 2022

Hi team, I have done some researches on this issue again and would like to share my findings here.

After digging much deeper of this issue, I have found that the cause of UnsupportedOperationExpection is due to inconsistency of modifying ObservableMap from FXCollections. For some reason, only the steps to reproduce issue in #8012 trigger ObservableMap to be immutable and throw exception if any methods try to modify it.

000

Both remove() and put() which modifies the ObservableMap. If immutable, both the methods will throw exception.

111
222

Additional information:
Apologize that I have to raise my findings from technical perspective here instead of creating a new PR as I could not find a solution for this issue just yet.

@ThiloteE
Copy link
Member Author

ThiloteE commented May 30, 2022

Thank you! Don't worry, it is fine to post your findings here. Last time I might have overreacted slightly when I argued that Issues are mainly for Issue description / enhancement and feature ideas / design and discussion about how JabRef ought to be and you might have seen that post. Since then, I have come to realize: Discussion is good. Posting code and posting findings is good, even though newbies might not understand it. Too much discussion can be distracting though, but no worries :), in theory, if a discussion were to become too complicated and messy, we can always close it and create a follow up issue with a nice summary for all the people that don't want to dig through 50 pages of text xD

@Siedlerchr
Copy link
Member

Thanks for the detailed analysis! I think the problem is that you somewhere have a SortedList which is immutable.
And I suspect it's the SortedList of the mainTable which triggers somehow a listener on the selectedItems changes

@ilippert
Copy link
Contributor

ilippert commented Jun 1, 2022

JabRef 5.7--2022-05-29--e8b80da
Linux 5.17.11-300.fc36.x86_64 amd64
Java 18.0.1
JavaFX unknown

I experience the same behaviour for non-custom fields, such as author or editor.

@LIM0000
Copy link
Contributor

LIM0000 commented Jun 2, 2022

@Siedlerchr Could we reopen #8012? I would suggest to revert PR #8821 to retain the ability to edit field in bibtex source tab before we found a better solution for issue #8012.
I have looked into #8012 again and still could not find the main reason that causes both UnsupportedOperationExpection and ArrayIndexOutOfBoundsException

@koppor koppor changed the title Since pr 8821 - Not possible to change or create custom fields in {} biblatex source tab Not possible to change or create custom fields in "{} biblatex source" tab Jun 6, 2022
@ThiloteE
Copy link
Member Author

ThiloteE commented Jun 7, 2022

Closing this issue, as the commit was reverted.

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 entry-editor
Projects
Archived in project
Development

No branches or pull requests

4 participants