Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Part of #1971384: [META] Convert page callbacks to controllers
For instructions on how to convert a page callback into a controller, see the WSCCI Conversion Guide.
Comments
Comment #1
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedComment #2
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedConverted this one. Not sure if this should be added to the existing LanguageTestController or should have an extra controller, because this is the only one that needs the http_kernel service.
Comment #3
dawehnerJust wondering whether it makes sense to use content when there is a subrequest anyway which will trigger the HtmlPageController anyway.
Should be better $this->httpKernel
Needs @return
Comment #4
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedThanks for the review!
Right. I wasn't aware there is anything else than _content when I wrote the patch.
Also fixed the variable name and the missing @return.
Comment #5
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedForgot this hunk:
Comment #6
dawehnerJust in case there is a rerole needed, let's use {@inheritdoc}
Comment #7
alexpottNeeds a reroll
Comment #8
vijaycs85Conflict is because of #1888424: Make Drupal's URL generation logic available to HttpKernel, and minimize code repetition/divergence landed. updated the code from callback to method.
Comment #9
Crell CreditAttribution: Crell commentedSeems straightforward enough to me.
Comment #10
alexpottAnd again...
Comment #11
vijaycs85Re-rolling...
Comment #12
Crell CreditAttribution: Crell commentedAnd again...
Comment #13
alexpottCommitted dec3e5c and pushed to 8.x. Thanks!
Comment #15
Gábor HojtsyRetroactive tags :)