ControllerResolver should use RouteObjectInterface::CONTROLLER_NAME instead of the _controller string

Created on 30 July 2025, 3 months ago

Problem/Motivation

The constant exists for this purpose but is not being used.

Steps to reproduce

N/A

Proposed resolution

Replace the string with the constant.

Remaining tasks

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

📌 Task
Status

Active

Version

11.0 🔥

Component

routing system

Created by

🇺🇸United States nicxvan

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @nicxvan
  • First commit to issue fork.
  • 🇧🇷Brazil julio_retkwa Balneário Camboriú

    I'll take a look on this

  • Merge request !12910Issue #3538669: use RouteObjectInterface → (Open) created by julio_retkwa
  • Pipeline finished with Success
    3 months ago
    #564733
  • 🇧🇷Brazil julio_retkwa Balneário Camboriú

    does that looks like as it should ?

  • 🇧🇷Brazil julio_retkwa Balneário Camboriú
  • 🇺🇸United States nicxvan

    nicxvan changed the visibility of the branch 3538669-controllerresolver-should-use to hidden.

  • 🇺🇸United States nicxvan

    nicxvan changed the visibility of the branch 3538669-controllerresolver-should-use to active.

  • 🇺🇸United States nicxvan

    I think it's supposed to be on the branch that was created, not the 11.x.

    I'm not sure if that actually causes a problem or not though.

  • 🇦🇺Australia mstrelan

    I think we should expand the scope to change this everywhere _controller is used.

    The constant is currently used in these places:

    \Drupal\jsonapi\Revisions\ResourceVersionRouteEnhancer::enhance
    \Drupal\jsonapi\Routing\Routes
    \Drupal\Tests\jsonapi\Unit\Routing\RoutesTest

    Should we update in the following places too:

    \Drupal\Core\Controller\ControllerResolver
    \Drupal\Core\Controller\ControllerResolverInterface (docs)
    \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer
    \Drupal\Core\Entity\EntityResolverManager
    \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider
    \Drupal\Core\Routing\Enhancer\FormRouteEnhancer
    ... probably some other places too

  • 🇺🇸United States nicxvan

    Let's take care of all of them and move to the branch the issue created.

  • Pipeline finished with Failed
    3 months ago
    #565034
  • First commit to issue fork.
  • Merge request !12940Issue #3538669: ControllerResolver should use... → (Closed) created by neerajsingh
  • 🇮🇳India neerajsingh IN 🇮🇳

    Raised PR with fixes in the following files:

    1. core/lib/Drupal/Core/Controller/ControllerResolverInterface.php
    2. core/lib/Drupal/Core/Entity/Enhancer/EntityRouteEnhancer.php
    3. core/lib/Drupal/Core/Entity/EntityResolverManager.php
    4. core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php
    5. core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php
    6. core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
  • Pipeline finished with Failed
    3 months ago
    Total: 139s
    #567532
  • Pipeline finished with Success
    3 months ago
    Total: 1162s
    #567545
  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • First commit to issue fork.
  • Pipeline finished with Success
    about 2 months ago
    Total: 2063s
    #592609
  • 🇪🇸Spain luismagr

    I've updated the fork with upstream. Let see what the bot says now

Production build 0.71.5 2024