Skip to content

Commit

Permalink
Fix BibTexStrings not included in backup file
Browse files Browse the repository at this point in the history
Fixes #12462
  • Loading branch information
Siedlerchr committed Feb 5, 2025
1 parent beefbaa commit 0536697
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where removing the sort from the table did not restore the original order. [#12371](https://github.com/JabRef/jabref/pull/12371)
- We fixed an issue where JabRef icon merges with dark background [#7771](https://github.com/JabRef/jabref/issues/7771)
- We fixed an issue where an entry's group was no longer highlighted on selection [#12413](https://github.com/JabRef/jabref/issues/12413)
- We fixed an issue where BibTeX Strings were not included in the backup file [#12462](https://github.com/JabRef/jabref/issues/12462)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.jabref.model.database.event.BibDatabaseContextChangedEvent;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.entry.BibtexString;
import org.jabref.model.metadata.SaveOrder;
import org.jabref.model.metadata.SelfContainedSaveOrder;

Expand All @@ -59,7 +60,7 @@ public class BackupManager {

private static final int DELAY_BETWEEN_BACKUP_ATTEMPTS_IN_SECONDS = 19;

private static Set<BackupManager> runningInstances = new HashSet<>();
private static final Set<BackupManager> runningInstances = new HashSet<>();

private final BibDatabaseContext bibDatabaseContext;
private final CliPreferences preferences;
Expand Down Expand Up @@ -268,6 +269,9 @@ void performBackup(Path backupPath) {
.map(BibEntry.class::cast)
.toList();
BibDatabase bibDatabaseClone = new BibDatabase(list);
bibDatabaseContext.getDatabase().getStringValues().stream().map(BibtexString::clone)
.map(BibtexString.class::cast)
.forEach(bibDatabaseClone::addString);
BibDatabaseContext bibDatabaseContextClone = new BibDatabaseContext(bibDatabaseClone, bibDatabaseContext.getMetaData());

Charset encoding = bibDatabaseContext.getMetaData().getEncoding().orElse(StandardCharsets.UTF_8);
Expand Down

0 comments on commit 0536697

Please sign in to comment.