- Issue created by @luisnicg
I had added the issue to the core, but according to the feedback, this bug should be fixed in the module. Here is the main issue:
https://www.drupal.org/project/drupal/issues/3382082
🐛
entityQuery is broken on PostgreSQL when using array of values with case insensitive properties
Active
More context about the causes can be found here:
https://www.drupal.org/node/3350985 →
In the submission of the import form there is an ::entityQuery() with a condition that looks for the uuid based on an array of values, this condition requires to execute the translateCondition() function during the compile() process.
This condition causes a syntax error on PostgreSQL since the operator is not defined, here is the condition
$menuLinkEntity = \Drupal::entityQuery('menu_link_content')
->accessCheck(FALSE)
->condition('uuid', $menu['uuid'])
->execute();
Use entityQuery() with an array of values, when using a sensitive case field without specifying an operator.
It only happens on PostgreSQL
$nodes = \Drupal::entityQuery('node')
->condition('uuid', $uuid_array)
->execute();
The operator needs to be specified.
$menuLinkEntity = \Drupal::entityQuery('menu_link_content')
->accessCheck(FALSE)
->condition('uuid', $menu['uuid'], 'IN')
->execute();
Another possible solution could be to send the value instead of the array:
$menuLinkEntity = \Drupal::entityQuery('menu_link_content')
->accessCheck(FALSE)
->condition('uuid', $menu['uuid']['value'])
->execute();
Active
1.0
Code
Particularly affects sites running on the PostgreSQL database.