Use CallableResolver for \Drupal\Core\Access\CustomAccessCheck::access()

Created on 29 May 2023, over 1 year ago
Updated 3 January 2024, 11 months ago

Problem/Motivation

Follow up from 📌 Introduce CallableResolver to help standardise the DX and error handling for callbacks across various subsystems Fixed . We should use CallableResolver for \Drupal\Core\Access\CustomAccessCheck::access

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

11.0 🔥

Component
Base 

Last updated about 6 hours ago

Created by

🇦🇺Australia kim.pepper 🏄‍♂️🇦🇺Sydney, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kim.pepper
  • Status changed to Needs review about 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update about 1 year ago
    30,481 pass
  • Status changed to RTBC about 1 year ago
  • 🇺🇸United States smustgrave

    CR reads fine and trigger_error is there. No failures so think this is good.

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update about 1 year ago
    30,483 pass
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update about 1 year ago
    30,486 pass
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update about 1 year ago
    30,486 pass
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update about 1 year ago
    30,493 pass
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update about 1 year ago
    30,512 pass
  • Status changed to Needs work about 1 year ago
  • The Needs Review Queue Bot tested this issue.

    While you are making the above changes, we recommend that you convert this patch to a merge request . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

  • First commit to issue fork.
  • @_shy opened merge request.
  • Status changed to Needs review about 1 year ago
  • 🇺🇦Ukraine _shy Ukraine, Lutsk 🇺🇦

    Created MR from the patch, all tests are green.

  • Status changed to RTBC about 1 year ago
  • 🇺🇸United States smustgrave

    Reroll to MR seems fine.

  • 🇺🇸United States xjm
  • Status changed to Fixed 11 months ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    Committed 58777e0 and pushed to 11.x. Thanks!

    diff --git a/core/lib/Drupal/Core/Access/CustomAccessCheck.php b/core/lib/Drupal/Core/Access/CustomAccessCheck.php
    index c7d0b5657a..fcdaabf16e 100644
    --- a/core/lib/Drupal/Core/Access/CustomAccessCheck.php
    +++ b/core/lib/Drupal/Core/Access/CustomAccessCheck.php
    @@ -46,7 +46,7 @@ class CustomAccessCheck implements RoutingAccessInterface {
        */
       public function __construct(ControllerResolverInterface|CallableResolver $callable_resolver, AccessArgumentsResolverFactoryInterface $arguments_resolver_factory) {
         if ($callable_resolver instanceof ControllerResolverInterface) {
    -      @trigger_error('Calling ' . __METHOD__ . '() with an argument of ControllerResolverInterface is deprecated in drupal:10.2.0 and is removed in drupal:11.0.0. Use \Drupal\Core\Utility\CallableResolver instead. See https://www.drupal.org/node/3397706', E_USER_DEPRECATED);
    +      @trigger_error('Calling ' . __METHOD__ . '() with an argument of ControllerResolverInterface is deprecated in drupal:10.3.0 and is removed in drupal:11.0.0. Use \Drupal\Core\Utility\CallableResolver instead. See https://www.drupal.org/node/3397706', E_USER_DEPRECATED);
           $callable_resolver = \Drupal::service('callable_resolver');
         }
         $this->callableResolver = $callable_resolver;
    

    Changed deprecation version to 10.3.0 on commt.

    • alexpott committed 9e3a13aa on 11.x
      Issue #3363423 by _shY, vbouchet: Use CallableResolver for \Drupal\Core\...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024