Problem/Motivation

Child of #3584794: [meta] Convert core routes to PHP attributes

Steps to reproduce

Proposed resolution

Routing definitions for test controllers will be moved to attributes on the controller where possible.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3617973

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

longwave created an issue. See original summary.

longwave-bot made their first commit to this issue’s fork.

longwave’s picture

Status: Active » Needs review

Unsure if this is too big to review, let's see.

While I was here I decided to remove all titles that weren't explicitly tested, I don't see the point in carrying all those around.

This MR was generated by an LLM.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.84 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. 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.

longwave’s picture

Status: Needs work » Needs review
mstrelan’s picture

Status: Needs review » Needs work

This is indeed long, but it's mostly the same pattern, and in most cases the yaml file appears near the class in the MR.

It occurred to me that we should have a more ergonomic way to do this: requirements: ['_access' => 'TRUE'] but I'm not sure what would be most appropriate.

I commented on a few places that I thought we were able to use the title arg to pass a callback, but maybe I've mis-remembered how that works. Setting NW but please set back if we can't actually do that.

mstrelan’s picture

And one more question - if there is no title, and the controller doesn't return a title either, are there any warnings or notices?

longwave’s picture

Status: Needs work » Needs review

The \d conversion looks correct to me, I think there would be a test failure otherwise.

We can't backport the title callbacks to 11.x, so maybe we should do that in #3615108: Move _title and _title_callback out of defaults section in existing route attributes? Same for improving boolean requirements which has an issue already: #2726519: Leverage improved DX in route requirements

If there is no title then you just get an empty title on the page.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

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.