Fix action helper#6122
Conversation
I is hard to test this, as normally a selection should be given when the method is triggered. Fixes #6085
Co-Authored-By: Tobias Diez <tobiasdiez@gmx.de>
|
Thanks @tobiasdiez , that looks good! |
c3df843 to
058c725
Compare
|
Does this also cover the case that an entry stays selected while a field is emptied in the entry editor? |
| } else { | ||
| return entry.get().getFields().stream().anyMatch(fields::contains); | ||
| } | ||
| }, selectedEntries); |
There was a problem hiding this comment.
I'm missing entry.getFieldsObserable() here. Is this intended?
There was a problem hiding this comment.
Good catch. This is a problem - it might not be available (that's why I need the complex code above). I'm not sure what side effects this might have, I need you guys' expertise here.
There was a problem hiding this comment.
Not sure but maybe the following works:
EasyBind.monadic(entry)
.flatMap(BibEntry:getFieldsObservable)
.map(entryFields -> entryFields.anyMatch(...))
There was a problem hiding this comment.
When does this situation occur? I.e. the fields of the entry change dynamically?
There was a problem hiding this comment.
This binding should update in the case when the selected entry changes as well as when the fields of the currently selected entry change
We need to test this. Probably not right now as the binding to getFields() is missing like you already mentioned. |
|
What's the status here? |
|
I have no correct solution for both cases as discussed above. however, I'm not sure if the field change? can actually occur. |
|
Maybe with extractor. |
|
I can reproduce the error always if I close all databases and then try to click on the View Menu. Also on Windows |
|
I found a way to fix the binding. It should work now. |
Siedlerchr
left a comment
There was a problem hiding this comment.
Does this also work for the view menu with no database open?
* upstream/master: Fix action helper (#6122)
7bde3e4 Add style for the Geographical Analysis journal (#6145) 6fa1551 Create taylor-and-francis-chicago-b-author-date.csl (#6232) eba2e8c Create taylor-and-francis-ama.csl (#6221) dda9d57 ACS, AMA, Vancouver: Remove hardcoded space after `citation-number` (#6248) 8f5fe92 GitHub Workflows security hardening (#6246) 284bc10 Create angiology.csl (#6122) eb141cc Update society-of-biblical-literature-fullnote-bibliography.csl (#6157) dddb459 Rewrite law-citation-manual.csl (#6171) (#6171) b975c96 Update Cell to numeric-superscript style (#6245) 3a41b08 Create isara-iso-690.csl (#6201) 5a128fe Create Biomembranes.csl (#6200) da2e0c0 Capitalize-first short titles for legislation ("Statute"). (#6241) af7f08d Create proceedings-of-the-estonian-academy-of-sciences-author-date.csl (#6209) git-subtree-dir: buildres/csl/csl-styles git-subtree-split: 7bde3e4
The only reason I can think of might be caused by the following code snippet:
BibEntry entry = stateManager.getSelectedEntries().get(0);Also I do not know how to trigger this method without an entry selected it might still be an empty list.
At least this is what the error log says. So we can only get the entry when it exists.
Fixes #6085.
How to reproduce: