Problem/Motivation

Steps to reproduce

After installing the HTTP Response Headers module, I have tried to add cache control header. On saving the header it throws an error that says Error: Call to undefined method Drupal\Core\Config\Entity\ConfigEntityStorage::accessCheck()

CommentFileSizeAuthor
remove_access_check.patch640 byteskrishnaveniuppara
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

KrishnaveniUppara created an issue. See original summary.

avpaderno’s picture

Title: accessCheck() issue » Error: Call to undefined method Drupal\Core\Config\Entity\ConfigEntityStorage::accessCheck()
Version: 8.x-2.0-rc2 » 8.x-2.x-dev
avpaderno’s picture

Status: Needs review » Needs work
-    $entity = $this->entityTypeManager->getStorage('response_header')->accesCheck(FALSE)->getQuery()
+    $entity = $this->entityTypeManager->getStorage('response_header')->getQuery()

Actually, the object returned from getQuery() has the accessCheck() method. The correct code is the following one.

$entity = $this->entityTypeManager->getStorage('response_header')->getQuery()->accesCheck(FALSE)
  ->condition('id', $id)
  ->execute();

keshav.k made their first commit to this issue’s fork.

keshavv’s picture

Status: Needs work » Needs review

Thank you @apaderno

I have created the MR for the same.
Please Review.

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

The MR correctly changes the code.

  • minnur committed 3c61de69 on 8.x-2.x authored by keshav.k
    Issue #3375197: Error: Call to undefined method Drupal\Core\Config\...
avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.