Skip to content
Snippets Groups Projects
Commit 2ccb0f6c authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1901546 by Berdir, chx: Fixed Random failures in...

Issue #1901546 by Berdir, chx: Fixed Random failures in Drupal\system\Tests\Entity\ConfigEntityQueryTest.
parent c4c71f4c
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -114,13 +114,18 @@ protected function matchArray(array $condition, array $data, array $needs_matchi
$candidates = array($parent);
}
foreach ($candidates as $key) {
if ($needs_matching && is_array($data[$key])) {
$new_parents = $parents;
$new_parents[] = $key;
if ($this->matchArray($condition, $data[$key], $needs_matching, $new_parents)) {
return TRUE;
if ($needs_matching) {
if (is_array($data[$key])) {
$new_parents = $parents;
$new_parents[] = $key;
if ($this->matchArray($condition, $data[$key], $needs_matching, $new_parents)) {
return TRUE;
}
}
}
// Only try to match a scalar if there are no remaining keys in
// $needs_matching as this indicates that we are looking for a specific
// subkey and a scalar can never match that.
elseif ($this->match($condition, $data[$key])) {
return TRUE;
}
......
......@@ -425,6 +425,13 @@ protected function testDotted() {
->condition('array.level1.level2', 3)
->execute();
$this->assertResults(array('5'));
// Make sure that values on the wildcard level do not match if if there are
// sub-keys defined. This must not find anything even if entity 2 has a
// top-level key number with value 41.
$this->queryResults = $this->factory->get('config_query_test')
->condition('*.level1.level2', 41)
->execute();
$this->assertResults(array());
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment