Wrong comparator show in Hybris Backoffice for enum field

336 Views Asked by At

I've got a peculiar problem in Hybris Backoffice. When I search for Promotion Rules (Marketing->Promotion Rules), one of the available fields is Type. Yet, when I try to use that field, the comparator in the advanced search widget is incorrect. The type of status field is HybrisEnumValue. However the comparator only contains three options: In, Is Empty and Is not empty:

enter image description here

As an example, Order Status is also a field with type HybrisEnumValue, however in the advanced search it does show correct comparator options:

enter image description here

Obviously, this In operator causes problems down the line when searching. How can get it to display the correct comparator values, that is, Equals instead of In?

EDIT: As evident from the answer by @geffchang I didn't make it clear that I can only select a single value:

enter image description here

Further, when Hybris translates the query into SQL, it ends up with a wrong WHERE clause: WHERE item_t0.p_status IN ? - instead of in it should have =

2

There are 2 best solutions below

7
geffchang On

What issues are you seeing?

Personally, I think this is fine. In lets you select multiple values in OR fashion. So, Status in (Published, Unpublished) gives you both published and unpublished rules. If you want Published only, that's also fine.

enter image description here

0
Moksh Gupta On

this is due to OOTB functionality , because of which "Equals" operator is replaced by "IN" operator , you can add above bean in your backoffice-spring.xml and issue will be fixed -: bean_screenshot