-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.4.0, 3.0.0
-
Release Notes Summary:The nuxeo-directory-suggestion element manages to save the "false" value used in a search form.
-
Tags:
-
Backlog priority:650
-
Sprint:UI - 2023-3, UI - 2023-4, UI COOLDOWN - 2023-3
-
Story Points:3
When having equipped a search form with a nuxeo-directory-suggestion tied to a Page Provider predicate for a Boolean schema property, Saved Searches from this form fail to save the input value of "false".
Steps to reproduce:
- Create a YesNo_Bool Vocabulary with these 2 entries :
ID: true, label: Yes ID: false, label: No
- Make a custom Document type with a Boolean field (in example jar attached, doctype is InvoiceTwo, and field is invoicetwo:discount)
- In the document Create layout, have the Boolean field configurable with a checkbox element.
- Make a custom Page Provider with a predicate on the Boolean field using the equals operator (in example, pp_InvoiceTwoSearch)
- Add the Boolean field in the search form layout using a nuxeo-directory-suggestion element for the Boolean field.
- Enable the search as a Drawer item accessible from the left-hand drawer.
- Create two of these documents - one with Boolean field checked (to have value true), the other checked and then unchecked (value false).
- Go to the search form (InvoiceTwo Search in the example) and select the "No" value from the widget.
- Hit the search button - observe the document with value False is returned.
- Save this search (with name "No Discount for example).
- Refresh the browser and navigate back to the saved search.
Expected behavior: the saved search is returned with "No" populated in the nuxeo-directory-suggestion, and the only Document returned is the one with "false" for its Boolean property.
Actual Behavior: the saved search is returned with the nuxeo-directory-suggestion blank, and both Documents are returned in the search.
Note: this is not reproducible while populating the widget with Yes ("true"), as the Saved Search preserves the value as expected.
(see attached video - Studio project zips attached have set up doctype, search, and vocabulary needed to reproduce the issue).