Commit 6838c0a7 authored by Yaroslav  Kozak's avatar Yaroslav Kozak Committed by Ken Rickard
Browse files

Issue #3291184 by quadrexdev: Fix "Missing explicit access check on entity query" warning

parent ac5dec38
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -232,9 +232,6 @@ parameters:
    - "#^Unsafe usage of new static#"
    # Ignore common errors for now.
    - "#Drupal calls should be avoided in classes, use dependency injection instead#"
    # This check was ignored on purpose until the issues with it, which started in version 1.1.15, are solved.
    # @see https://www.drupal.org/node/3280328
    - "#^Missing explicit access check on entity query.#"
  drupal:
    entityMapping:
      domain:
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ class Domain extends ConfigEntityBase implements DomainInterface {
    parent::preCreate($storage_controller, $values);
    $domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
    $default = $domain_storage->loadDefaultId();
    $count = $storage_controller->getQuery()->count()->execute();
    $count = $storage_controller->getQuery()->accessCheck(FALSE)->count()->execute();
    $values += [
      'scheme' => empty($GLOBALS['is_https']) ? 'http' : 'https',
      'status' => 1,
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ class DomainForm extends EntityForm {
    $domain = $this->entity;

    // Create defaults if this is the first domain.
    $count_existing = $this->domainStorage->getQuery()->count()->execute();
    $count_existing = $this->domainStorage->getQuery()->accessCheck(FALSE)->count()->execute();
    if (!$count_existing) {
      $domain->addProperty('hostname', $this->domainStorage->createHostname());
      $domain->addProperty('name', $this->config('system.site')->get('name'));