cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Backoffice advanced search 'isEmpty' condition takes not the localised language selection into account

0 Likes
294

Hello,

When we perform a search on a localised field (for example 'identifier' from Product) and we select the condition 'isEmpty', then the selected language in the localised search field is not taken into account. The session language of the logged in user is used to perform the search. When we fill some value in the localised search field and change the condition back to 'isEmpty', then the selected language of the localised search field is taken into account.

Because there is nothing filled in the localised search field, no value is passed to the advanced search controller and this controller takes the locale of the logged in user to perform the search.

Does anyone has encounter this problem and how can this be solved?

Thanks at advance!

Kind regards, Taki

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member682593
Participant
0 Likes

I think you need to subclass the LocalizedSimpleEditor that's used there, and create your own MyLocalizedSimpleEditor with the fix you described. Then you need to change the editorRegistry bean, and for the entry

 <entry key="^LocalizedSimple\((.*)\)$" value="com.hybris.cockpitng.editor.localizedsimple"/>

You need to replace it with your own editor, like

 <entry key="^LocalizedSimple\((.*)\)$" value="com.hybris.cockpitng.editor.mylocalizedsimple"/>

This will replace all usages of the LocalizedSimpleEditor with your implementation.

Alternatively, if you just want to replace single usage of this editor, then instead of changing the editorRegistry, you can do it in the AdvancedSearch configuration like that:

 <advanced-search:field name="code" selected="true" editor="com.hybris.cockpitng.editor.mylocalizedsimple" />

Thanks, Marcin