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

No input field "editor" available in the entry editor for e.g. entry type @Misc in biblatex mode #5859

Closed
systemoperator opened this issue Jan 22, 2020 · 14 comments
Labels
bug Confirmed bugs or reports that are very likely to be bugs entry-editor

Comments

@systemoperator
Copy link
Contributor

I am using the latest JabRef 5 master build:
JabRef-5.0-portable_linux.tar.gz
JabRef 5.0-beta.360--2020-01-21--7ddfd9f
Linux 4.4.0-171-generic amd64
Java 13.0.2
on Ubuntu 16.04

I have enabled the biblatex mode for the current library as well as in the JabRef settings in general ("Default bibliography mode"). When I select an entry of e.g. type "Misc" in the list of references and I open the entry editor, then I cannot find the input field "Editor" in any of the listed tabs. This is independent of whether e.g. editor={Abc, Def} is actually defined in the this reference or not.

@Siedlerchr
Copy link
Member

This is totally odd. Could you please try resetting your preferences?

@Siedlerchr Siedlerchr added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Jan 23, 2020
@systemoperator
Copy link
Contributor Author

I have now resetted the preferences and restarted JabRef afterwards. Then I created a new biblatex library with a new "misc" entry type. The "editor" field still does not show up.

I have then closed JabRef once again and removed the whole settings directory located in ~/.java/.userPrefs/org/jabref and subsequently started JabRef. I created a new biblatex library with a new "misc" entry type. No "editor" field appeared.

For both aforementioned cases, JabRef shows the following:

image

image

image

Then I created a new bibtex library with a new "book" entry type. No "editor" field could be found either (assuming there should be one, as stated in the bibtex documentation, attached below).

JabRef shows the following:

image

image

bibtex (http://mirror.kumi.systems/ctan/biblio/bibtex/base/btxdoc.pdf) states for entry type "book:

"book":

  • A book with an explicit publisher.
  • Required fields: author or editor, title, publisher, year.
  • Optional fields: volume or number, series, address, edition, month, note

@Siedlerchr
Copy link
Member

Now I can reproduce it as well. Strange. @koppor @tobiasdiez Did we change that somehow or is this just some display issue?

@systemoperator
Copy link
Contributor Author

systemoperator commented Jan 30, 2020

When I look in RequiredFieldsTab.java and set a breakpoint at return fields; in the method SortedSet<Field> determineFieldsToShow(BibEntry entry), then I see that fields has the value ["AUTHOR", "KEY_FIELD", "DATE", "TITLE"] for the entry type "Misc" (so Editor is missing) for the reference

@Misc{ABC01,
  author    = {Coetzee, Derrick and Fox, Armando and Hearst, Marti},
  title     = {Author},
  timestamp = {2020-01-30},
  year      = {2005},
}

and also for the reference

@Misc{ABC02,
  editor    = {Coetzee, Derrick and Fox, Armando and Hearst, Marti},
  title     = {Editor},
  timestamp = {2020-01-30},
  year      = {2005},
}

as well as for the reference

@Misc{ABC03,
  editor    = {Coetzee, Derrick and Fox, Armando and Hearst, Marti},
  author    = {Coetzee, Derrick and Fox, Armando and Hearst, Marti},
  title     = {Editor and Author},
  timestamp = {2020-01-30},
  year      = {2005},
}

But Optional<BibEntryType> entryType in the same method SortedSet<Field> determineFieldsToShow(BibEntry entry) has the value Optional[BibEntryType{type=Misc, requiredFields=[[AUTHOR, EDITOR], [DATE], [TITLE]], type=...}].

So it doesn't seem to be a visual bug.

@Siedlerchr
Copy link
Member

Siedlerchr commented Jan 30, 2020

Well, the real field defintions are here in the BiblatexEntryTypeDefintions
RequiredFields etc is based on the current bib entry.

https://github.com/JabRef/jabref/blob/master/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java

.withRequiredFields(new OrFields(StandardField.AUTHOR, StandardField.EDITOR), StandardField.TITLE, StandardField.DATE)

@systemoperator
Copy link
Contributor Author

systemoperator commented Jan 30, 2020

Yes, I have seen that, but finally ["AUTHOR", "KEY_FIELD", "DATE", "TITLE"] will be returned for rendering the tab "Required fields". (But for some reason I have some difficulties in debugging in there.)

@tobiasdiez
Copy link
Member

I guess the problem is that Author/Editor is an or field (i.e. only one of them is required). Maybe do it like in the book definition and define Editor not as required but as an important field?

.withImportantFields(StandardField.EDITOR,
StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.MAINTITLE, StandardField.MAINSUBTITLE,
StandardField.MAINTITLEADDON, StandardField.VOLUME, StandardField.EDITION, StandardField.PUBLISHER, StandardField.ISBN,
StandardField.CHAPTER, StandardField.PAGES, StandardField.PAGETOTAL, StandardField.DOI, StandardField.EPRINT,
StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE)
.withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.DATE)

@systemoperator
Copy link
Contributor Author

systemoperator commented Jan 30, 2020

Remark: I guess, this problem will affect various entry types, so that some fields might not be shown at all (meaning: specific fields like Editor are sometimes shown nowhere, so neither in the tab "Required Fields" nor in the tab "Optional Fields", etc.). I would prefer, that all required "OrFields" show up in the tab "Required Fields". (Maybe it could be indicated somehow, that either the one or the other is finally required.)

@systemoperator
Copy link
Contributor Author

systemoperator commented Feb 1, 2020

I have noticed, that -- even if I changed something in BiblatexEntryTypeDefinitions.java, like converting new OrFields(StandardField.AUTHOR, StandardField.EDITOR) to StandardField.AUTHOR, StandardField.EDITOR for testing purposes -- the GUI did not reflect these changes, due to the fact, that in JabRefMain.java some custom or modified types get loaded:

    Globals.entryTypesManager.addCustomOrModifiedTypes(preferences.loadBibEntryTypes(BibDatabaseMode.BIBTEX),
            preferences.loadBibEntryTypes(BibDatabaseMode.BIBLATEX));

I found out, that these files are stored in:

~/.java/.userPrefs/org/jabref/customizedBiblatexTypes/prefs.xml

and

~/.java/.userPrefs/org/jabref/customizedBibtexTypes/prefs.xml

My questions:

  • How were they created?
  • Is it possible to simply disable these custom or modifed types?

@systemoperator
Copy link
Contributor Author

I would recommend for now that in RequiredFieldsTab.java the method determineFieldsToShow(BibEntry entry) resolves e.g. OrFields(StandardField.AUTHOR, StandardField.EDITOR) to StandardField.AUTHOR, StandardField.EDITOR by updating fields.addAll(entryType.get().getRequiredFields().stream().map(OrFields::getPrimary).collect(Collectors.toSet())); correspondingly.

How can this be achieved?

@Siedlerchr
Copy link
Member

The custom and builtin entry types can be modified using the dialog manage custom entry types. See my other PR, where I reimplemented that dialog

@systemoperator
Copy link
Contributor Author

Oh, I see, in the master branch, this entry in the options is currently hidden.

@systemoperator
Copy link
Contributor Author

@Siedlerchr Do you know how my suggestion (see above) could be implemented?

@tobiasdiez
Copy link
Member

Not completely sure, but the following might work: ̀fields.addAll(entryType.get().getRequiredFields()). The problem is the getPrimary call, which only gets the first of the OrField.

@tobiasdiez tobiasdiez added bug Confirmed bugs or reports that are very likely to be bugs entry-editor and removed status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Feb 1, 2020
koppor pushed a commit that referenced this issue Feb 1, 2022
76f23a2 Fix the order for conference papers in APA styles (#5875)
5125c43 Fix bibliography date sorting (#5876)
873df06 Change order of publisher and publisher-place (#5874)
8066c66 Fix independent for BioScientific Review
9cc567e Add AMA brackets w 2 dependents (#5871)
c33dd24 Create medicine-publishing.csl (#5866)
9cb9cdb Fishery&wildlife journals: Remove publishers for articles (#5868)
fbd9165 Update universitatsmedizin-gottingen.csl (#5864)
c563f03 Update mla8 and mla9 (#5859)
98d6a03 [ASM] Add DOI for preprints. (#5862)
05e7071 Create current-neurology-aktualnosci-neurologiczne.csl (#5858)
78d771d Update journal-of-clinical-neurophysiology.csl (#5857)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 76f23a2
@koppor koppor moved this to Done in Prioritization Nov 10, 2022
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

3 participants