Problem/Motivation
The patch from the parent issue works perfectly for ::loadByProperties() as it expects and array of values ββand will add IN operator, in my case I am facing the same problem using ::entityQuery(),
Steps to reproduce
Being more specific, I'm working with the menu_export module (and PostgreSQL of course) and it has this query:
$menuLinkEntity = \Drupal::entityQuery('menu_link_content')
->accessCheck(FALSE)
->condition('uuid', $menu['uuid'])
->execute();
Where $menu['uuid'] is an array of values.
The problem with this is that the condition operator is not defined, and when the translateCondition() is executed, it didn't add the operator, which should be "IN", causing this error:
SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "("
LINE 5: WHERE (LOWER("menu_link_content"."uuid") (LOWER('XXXXX
Proposed resolution
Not sure if it should be a core or module issue, I added a patch that worked for me.
I added the IN operator if $condition['operator'] is empty:
if (empty($condition['operator'])) {
$condition['operator'] = 'IN';
}
I didn't have enough time to add a test, it would be something like this:
$node1 = $this->drupalCreateNode([
'type' => 'page',
'field_first' => '1234',
'field_second' => 'test_value_1',
]);
$nodes = $this->container->get('entity_type.manager')->getStorage('node')->getQuery()->condition('uuid',[$node1->uuid()])->execute();
// @todo validate results