We have recently upgraded from Hybris 4.7.8 to 5.4.1 and noticed that the Hybirs UserService method isUserExisting() is not return the correct results when we are logged into our store as a B2BCustomer. I enabled JDBC logging to output the generated SQL and tracked the problem down to the typePkString clause that is appended to the query. The generated SQL is quite large however this is the area of concern:
SELECT item_t0.PK FROM users item_t0 WHERE ( item_t0.UniqueID ='functester1') AND (item_t0.TypePkString IN (8796094038098,8796094005330,8796119892050,8796093972562) AND ((item_t0.TypePkString IN ( 8796094038098,8796094005330,8796093972562 ) )));
The first AND adds the PK's of the Customer, Employee, B2BCustomer and User while the second AND adds the PK's for the Customer, Employee and User. The B2BCustomer is missing in the second generated AND clause thus the result is 0 records found. This happens when we log into our store front as a B2BCustomer. If we are under the anonymous user account this does not occur and the query returns the correct results of 1 record.
This is not related to a search restriction and since this is an out-of-the-box hybris query it's unclear why this is failing now in 5.4.1.
How is the isUserExisting() method building it's query and where does the typePkString data come from?
How can this be resolved?
Regards, Dan