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

JabRef reformats complete file on load #251

Closed
koppor opened this issue Aug 23, 2017 · 8 comments
Closed

JabRef reformats complete file on load #251

koppor opened this issue Aug 23, 2017 · 8 comments

Comments

@koppor
Copy link
Owner

koppor commented Aug 23, 2017

I collaboratively work on a paper and jabref reformats the whole bib file on load (and shows a star). How can this happen? Although I like this feature, I cannot find how to active/deactivte it

reformat-all gif

grafik

@koppor koppor added the v4 label Aug 23, 2017
@lenhard
Copy link
Collaborator

lenhard commented Aug 25, 2017

Just a wild guess, but I've had similar problems when entering field content that lead to an immediate reformatting of the field (which is fixed now).

The problem was that an EntryChangeEvent triggers the BackupManager and the BackupManager triggers the save actions that are configured. I guess it's the same for you here. So the solution should be:

  • Don't trigger save actions with the BackupManager does a backup (not sure if easily possible)
  • Find out why there's a change event fired when you just open the entry editor

@koppor
Copy link
Owner Author

koppor commented Aug 25, 2017

I think, there is no entry editor opened. At least, I don't see it initially.

@lenhard
Copy link
Collaborator

lenhard commented Aug 25, 2017

You are right. The database is immediately marked as dirty. But the change only happens when you click on an entry. This opens the entry preview and not the entry editor (my bad). One of these things (entry selection or opening entry preview) seems to trigger the event.

@koppor
Copy link
Owner Author

koppor commented Aug 25, 2017

Yes, it are the listeners. git bisect lead me to 59b9794 - introduced in JabRef#3001.

Damn it. This is only the change listener thing. Is just SHOWING that something was changed, but the real issue was introduced earlier.

@lenhard
Copy link
Collaborator

lenhard commented Aug 25, 2017

We should find out why already opening a database triggers a BibDatabaseContextChangedEvent (which is what the listeners react to). This is after all what the BasePanel reacts to.

@koppor
Copy link
Owner Author

koppor commented Aug 25, 2017

So, my next git bisect guess is edd3f7c coming from JabRef#2971. Checked it twice here.

Damn it. This works, because Ctrl+S works starting at this version.

OK, next round with git bisect. This time using the menu shortcuts.

@tobiasdiez
Copy link
Collaborator

tobiasdiez commented Aug 25, 2017

@koppor try to set a breakpoint in the file writing class and then just look at the stack trace to see what event triggered the save.

@koppor
Copy link
Owner Author

koppor commented Aug 25, 2017

It is somehow an interplay between save actions and some changes we did. - I cannot manually save the database, because this triggers the save actions and leads to a change of the file.

So, this is not a bug, it is a feature.

@koppor koppor closed this as completed Aug 25, 2017
@koppor koppor removed the v4 label Aug 25, 2017
koppor pushed a commit that referenced this issue Apr 3, 2023
a7c6f63e25 correct license to match the SPDX license identifier. (#281)
d704bf80af Update locales-nl-NL.xml (#229)
5ffb73b05a Bump nokogiri from 1.13.9 to 1.13.10 (#280)
04be62eda6 Update locales-pt-BR.xml (#251)
b4db583787 Update locales-pt-BR.xml (#265)
b656b1b6f9 Fix date format for Basque (#274)
e7ec9bff94 Bump nokogiri from 1.13.4 to 1.13.9 (#272)
9125705f62 Update locales-nl-NL.xml (#279)
87445b0b65 Add composer.json (#161)
2919a84bff Fix page label in NO locales

git-subtree-dir: buildres/csl/csl-locales
git-subtree-split: a7c6f63e25323ac2f375943417d7f778f875f11c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants