Problem/Motivation

List builders are not controllers; their namespace should not include \Controller\. Drupal core would ignore the namespace used for list builders, but using \Controller\ in their namespace will make people think that list builders are controllers, which is not exact.
Furthermore, since Drupal core will use PHP attributes to find controllers, and associate them to a route, it is important to put in a Controller directory only those files that contain a controller class, or Drupal core would parse files that do not contain controllers.

Proposed resolution

Do not use a namespace that contains \Controller\ for list builders.

Issue fork examples-3584457

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

avpaderno created an issue. See original summary.

avpaderno’s picture

The correct terminology for Drupal 8+ is entity handler: an entity list builder and a class that handles access to an entity are entity handlers, not entity controllers.

avpaderno’s picture

For Drupal core, there are #3584795: Remove non-controller classes from module Controller namespaces/folders and #3585072: Move controller classes to Controller namespaces. Moving classes that are not controllers from outside the Controller directory avoids that Drupal core checks for attributes in classes that are not controllers.

avpaderno’s picture

Category: Bug report » Task
avpaderno’s picture

avpaderno’s picture

Assigned: Unassigned » avpaderno
avpaderno’s picture

Status: Active » Needs review

avpaderno’s picture

Issue summary: View changes
avpaderno’s picture

Assigned: avpaderno » Unassigned
Status: Needs review » Reviewed & tested by the community

  • avpaderno committed 902403e8 on 5.0.x
    Issue #3584457: List builders are not controllers
    
avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • avpaderno committed 2a3341d6 on 5.0.x
    Issue #3584457: List builders are not controllers
    

  • avpaderno committed f15ab132 on 5.0.x
    Issue #3584457: List builders are not controllers
    

Status: Fixed » Closed (fixed)

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