Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Given the following code:
$storage = $this->entityTypeManager->getStorage('group_type');
$group_type_ids = $storage->getQuery()
->notExists('third_party_settings.subgroup')
->execute();
and there being a group type that does not have any third party settings, I'd expect to get said group type's ID from the query.
Instead, I receive nothing. This is because of the following lines in Condition::matchArray()
if (is_array($data[$key])) {
$new_parents = $parents;
$new_parents[] = $key;
if ($this->matchArray($condition, $data[$key], $needs_matching, $new_parents)) {
return TRUE;
}
}
// Failing the above block leads to FALSE return value.
So unless the full parent path to the property (in this case third_party_settings) is set, matchArray() will never get to call match() where it checks the IS NULL condition.
Comment | File | Size | Author |
---|---|---|---|
#4 | drupal-3154858-4.patch | 2.17 KB | kristiaanvandeneynde |
#4 | drupal-3154858-4-test-only.patch | 1.18 KB | kristiaanvandeneynde |
Comments
Comment #2
kristiaanvandeneyndeNot sure where this is being tested, but here's what worked for me.
Comment #4
kristiaanvandeneyndeAha, now that we know where the tests are, we can create a test-only patch and one that proves this works.
I also put the original fix one level too deep when copying the code from my local.
Comment #6
alvar0hurtad0Looks good to me.
Comment #16
catchs/follower/followed/ fixed on commit to 9.1.x, backported to 8.9.x, thanks!