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

Created on 29 May 2023, about 1 year ago
Updated 3 January 2024, 6 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 1 minute 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 8 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update 8 months ago
    30,481 pass
  • Status changed to RTBC 8 months 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 8 months ago
    30,483 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update 8 months ago
    30,486 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update 8 months ago
    30,486 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update 8 months ago
    30,493 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update 8 months ago
    30,512 pass
  • Status changed to Needs work 8 months 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 8 months ago
  • πŸ‡ΊπŸ‡¦Ukraine _shY Lutsk

    Created MR from the patch, all tests are green.

  • Status changed to RTBC 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Reroll to MR seems fine.

  • πŸ‡ΊπŸ‡ΈUnited States xjm
  • Status changed to Fixed 6 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.69.0 2024