Commit 63e76048 authored by catch's avatar catch
Browse files

Issue #3357646 by Spokje: Fix 2 PHPStan L1 errors "Relying on entity queries...

Issue #3357646 by Spokje: Fix 2 PHPStan L1 errors "Relying on entity queries to check access by default is deprecated..." in the Layout Builder module
parent 8a84a237
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -172,7 +172,9 @@ public function preSave(EntityStorageInterface $storage) {
   *   The name for the layout section field.
   */
  protected function removeSectionField($entity_type_id, $bundle, $field_name) {
    $query = $this->entityTypeManager()->getStorage($this->getEntityTypeId())->getQuery()
    /** @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface $storage */
    $storage = $this->entityTypeManager()->getStorage($this->getEntityTypeId());
    $query = $storage->getQuery()
      ->condition('targetEntityType', $this->getTargetEntityTypeId())
      ->condition('bundle', $this->getTargetBundle())
      ->condition('mode', $this->getMode(), '<>')
+3 −1
Original line number Diff line number Diff line
@@ -143,7 +143,9 @@ protected function isCanonicalMode($mode) {

    // The default mode is valid if the canonical mode is not enabled.
    if ($mode === 'default') {
      $query = $this->entityTypeManager->getStorage($this->entity->getEntityTypeId())->getQuery()
      /** @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface $storage */
      $storage = $this->entityTypeManager->getStorage($this->entity->getEntityTypeId());
      $query = $storage->getQuery()
        ->condition('targetEntityType', $this->entity->getTargetEntityTypeId())
        ->condition('bundle', $this->entity->getTargetBundle())
        ->condition('status', TRUE)
+0 −10
Original line number Diff line number Diff line
@@ -1375,16 +1375,6 @@ parameters:
			count: 1
			path: modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php

		-
			message: "#^Relying on entity queries to check access by default is deprecated in drupal\\:9\\.2\\.0 and an error will be thrown from drupal\\:10\\.0\\.0\\. Call \\\\Drupal\\\\Core\\\\Entity\\\\Query\\\\QueryInterface\\:\\:accessCheck\\(\\) with TRUE or FALSE to specify whether access should be checked\\.$#"
			count: 1
			path: modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php

		-
			message: "#^Relying on entity queries to check access by default is deprecated in drupal\\:9\\.2\\.0 and an error will be thrown from drupal\\:10\\.0\\.0\\. Call \\\\Drupal\\\\Core\\\\Entity\\\\Query\\\\QueryInterface\\:\\:accessCheck\\(\\) with TRUE or FALSE to specify whether access should be checked\\.$#"
			count: 1
			path: modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php

		-
			message: "#^Constructor of class Drupal\\\\link\\\\Plugin\\\\migrate\\\\process\\\\FieldLink has an unused parameter \\$migration\\.$#"
			count: 1