I tried this answer:
https://drupal.stackexchange.com/a/298084/1082
But I can't seem to use
'field_scientists' => $entity_reference_uuid
where, in my case, field_scientists
is a field of type Entity Reference UUID - which is a field type provided by https://www.drupal.org/project/entity_reference_uuid module
What happens for me is that I get nothing back, my results array from that example is empty.
Looking to do this programmatically in my own custom module, rather than use a Drupal View.
If there's another way e.g. that uses the ->query
method for querying the database I'd be happy to use that programmatic approach.
Thank you.
Update
An example of a uuid
of a node
in my case is BMSSYS0000051988
.
This was set in a migration import from a field in a CSV.
My attempts are:
1. based on the example in the other question: https://drupal.stackexchange.com/a/298084/1082
$nodes = \Drupal::entityTypeManager()->getStorage('node')->loadByProperties([
'type' => 'bol',
'field_parent_uuid' => $taxonkey,
]);
2. db query
$query = \Drupal::entityQuery('node')
->condition('status', NODE_PUBLISHED)
->condition('type', 'bol');
$and = $query->andConditionGroup();
$and->condition('field_parent_uuid', $taxonkey);
$query->condition($and);
$result = $query->execute();
where $taxonkey
is BMSSYS0000051988
both 1 and 2 attempts above return an empty array.
I'm almost ripping my hair out of over this, why it doesn't work...