Aleks G
Aleks G

Reputation: 57336

Wrong comparator show in Hybris Backoffice for enum field

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 =

Upvotes: 0

Views: 405

Answers (2)

Moksh Gupta
Moksh Gupta

Reputation: 1

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

Upvotes: 0

geffchang
geffchang

Reputation: 3340

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

Upvotes: 0

Related Questions