From 02dae3cf4ca776c15f2473ee4c2d467a3ddd0d9a Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Tue, 12 Jun 2018 18:57:47 +0200 Subject: [PATCH 1/2] Fix convert to bibtex moves contents of the file field Fixes #4210 --- CHANGELOG.md | 2 ++ .../java/org/jabref/model/entry/EntryConverter.java | 1 - .../logic/cleanup/ConvertToBibtexCleanupTest.java | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c5683936b4..859d96ca3fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We reworked the "Edit file" dialog to make it resizeable and improved the workflow for adding and editing files https://github.com/JabRef/jabref/issues/2970 - We fixed an issue where the month was not shown in the preview https://github.com/JabRef/jabref/issues/3239. - Rewritten logic to detect a second jabref instance. [#4023](https://github.com/JabRef/jabref/issues/4023) +- We fixed an issue where the "Convert to BibTeX-Cleanup" moved the content of the `file` field to the `pdf` field [#4210](https://github.com/JabRef/jabref/issues/4120) + ### Removed - The feature to "mark entries" was removed and merged with the groups functionality. For migration, a group is created for every value of the `__markedentry` field and the entry is added to this group. diff --git a/src/main/java/org/jabref/model/entry/EntryConverter.java b/src/main/java/org/jabref/model/entry/EntryConverter.java index 131ef12bb1a..8a607b05647 100644 --- a/src/main/java/org/jabref/model/entry/EntryConverter.java +++ b/src/main/java/org/jabref/model/entry/EntryConverter.java @@ -25,7 +25,6 @@ public class EntryConverter { EntryConverter.FIELD_ALIASES_TEX_TO_LTX.put("archiveprefix", FieldName.EPRINTTYPE); EntryConverter.FIELD_ALIASES_TEX_TO_LTX.put(FieldName.JOURNAL, FieldName.JOURNALTITLE); EntryConverter.FIELD_ALIASES_TEX_TO_LTX.put(FieldName.KEY, "sortkey"); - EntryConverter.FIELD_ALIASES_TEX_TO_LTX.put(FieldName.PDF, FieldName.FILE); EntryConverter.FIELD_ALIASES_TEX_TO_LTX.put("primaryclass", FieldName.EPRINTCLASS); EntryConverter.FIELD_ALIASES_TEX_TO_LTX.put(FieldName.SCHOOL, FieldName.INSTITUTION); diff --git a/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java index df46c7da884..08ab57eae9d 100644 --- a/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java @@ -51,4 +51,14 @@ public void cleanupMovesJournaltitleToJournal() { assertEquals(Optional.empty(), entry.getField(FieldName.JOURNALTITLE)); assertEquals(Optional.of("Best of JabRef"), entry.getField(FieldName.JOURNAL)); } + + @Test + public void cleanUpDoesntMoveFileField() { + String fileField = ":Ambriola2006 - On the Systematic Analysis of Natural Language Requirements with CIRCE.pdf:PDF"; + BibEntry entry = new BibEntry().withField(FieldName.FILE, fileField); + + worker.cleanup(entry); + + assertEquals(Optional.of(fileField), entry.getField(FieldName.FILE)); + } } From aca4b9b1f52c85f46b06697871bc69b699340632 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Tue, 12 Jun 2018 19:02:58 +0200 Subject: [PATCH 2/2] fix twisted numbers of issue --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 859d96ca3fb..3610f003d87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We reworked the "Edit file" dialog to make it resizeable and improved the workflow for adding and editing files https://github.com/JabRef/jabref/issues/2970 - We fixed an issue where the month was not shown in the preview https://github.com/JabRef/jabref/issues/3239. - Rewritten logic to detect a second jabref instance. [#4023](https://github.com/JabRef/jabref/issues/4023) -- We fixed an issue where the "Convert to BibTeX-Cleanup" moved the content of the `file` field to the `pdf` field [#4210](https://github.com/JabRef/jabref/issues/4120) +- We fixed an issue where the "Convert to BibTeX-Cleanup" moved the content of the `file` field to the `pdf` field [#4120](https://github.com/JabRef/jabref/issues/4120) ### Removed