Commit 44918b7b authored by catch's avatar catch
Browse files

Issue #3154858 by kristiaanvandeneynde:...

Issue #3154858 by kristiaanvandeneynde: Drupal\Core\Config\Entity\Query\Condition::notExists() does not work when parent property is also missing

(cherry picked from commit 87468a5d)
parent 33b050ca
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -130,6 +130,11 @@ protected function matchArray(array $condition, array $data, array $needs_matchi
            return TRUE;
          }
        }
        // If the parent does not exist, it's safe to say the actual property
        // we're checking for is also NULL.
        elseif ($condition['operator'] === 'IS NULL') {
          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
+10 −0
Original line number Diff line number Diff line
@@ -606,6 +606,16 @@ public function testDotted() {
      ->notExists('array')
      ->execute();
    $this->assertResults([]);
    // Make sure that "IS NULL" and "IS NOT NULL" work correctly when the dotted
    // path cannot be fully followed.
    $this->queryResults = $this->entityStorage->getQuery()
      ->exists('does.not.exist')
      ->execute();
    $this->assertResults([]);
    $this->queryResults = $this->entityStorage->getQuery()
      ->notExists('does.not.exist')
      ->execute();
    $this->assertResults($all);
  }

  /**