Problem/Motivation

Split from #3584823: Convert system module routes to use attributes

These were split because they are more complex and harder to test that the first batch.

  • TimeZoneController
  • BatchController
  • EntityAutocompleteController
  • CsrfTokenController

These were postponed on #3585072: Move controller classes to Controller namespaces but have been moved here:

  • CronController - not in Controller namespace
  • FileDownloadController - not in Controller namespace

Also wondering if now that we don't need a routing.yml file it is possible to move some of these out of system module. For example, EntityAutocompleteController could move to the Drupal\Core\Entity\Controller namespace.

Steps to reproduce

Proposed resolution

  • Move CronController and FileDownloadController to the Drupal\system\Controller namespace
  • Add stubs to deprecate these classes. This is preferred over moved_classes for easier contrib compatibility.
  • Convert routing yaml definitions to PHP attributes

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3585079

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

mstrelan created an issue. See original summary.

mstrelan’s picture

Title: [PP-2] Convert remaining system module routes to use attributes » [PP-1] Convert remaining system module routes to use attributes

#3584823: Convert system module routes to use attributes is in. We can wait for #3585072: Move controller classes to Controller namespaces or we can possibly move the two affected classes in this issue. Or we can split this again and work on the 4 remaining classes that are in the correct namespace.

mstrelan’s picture

Title: [PP-1] Convert remaining system module routes to use attributes » Convert remaining system module routes to use attributes
Status: Postponed » Needs review

Will need a CR for the moved classes, the rest can be reviewed.

mstrelan’s picture

Status: Needs review » Needs work

Unfortunately moved_classes doesn't seem to work as advertised.

mstrelan’s picture

Issue summary: View changes
Status: Needs work » Needs review

Swapped to stubs instead of moved_classes, it's much easier for contrib to deal with and support multiple versions.

nicxvan’s picture

Unfortunately moved_classes doesn't seem to work as advertised.

What exactly doesn't work?

mstrelan’s picture

@nicxvan it still causes phpstan to fail. But now on reflection, that's by design. But handling multiple versions in contrib is still painful due to mismatched phpstan errors, so I don't think it's worth it..