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.
Test process :
-Apply patch
-Refresh Cache
-Check that block pages like :
-- /admin/structure/block/demo/bartik
-- /admin/structure/block/demo/seven
are still ok
| Comment | File | Size | Author |
|---|---|---|---|
| #55 | block-conversion-1987636-55-FAIL.patch | 4.33 KB | tim.plunkett |
| #55 | block-conversion-1987636-55-PASS.patch | 4.5 KB | tim.plunkett |
| #55 | interdiff.txt | 2.59 KB | tim.plunkett |
| #52 | block-conversion-1987636-52.patch | 3.31 KB | kgoel |
| #52 | interdiff.txt | 1014 bytes | kgoel |
Comments
Comment #1
pdrake commentedComment #2
pdrake commentedComment #3
pdrake commentedComment #4
pdrake commentedComment #5
kim.pepper#4: drupal-convert_block_admin_demo-1987636-4.patch queued for re-testing.
Comment #7
kim.pepperComment #8
vijaycs85Re-rolling...
Comment #9
dawehnerThe other theme is stilled picked up, during manual testing.
Can we add a documentation what's going on here?
Config is a service so let's use Drupal::config() instead.
This dependency is not needed
just remove this empty line.
Can you open a follow up to convert this into a library?
Can't we also just return '' ?
Comment #10
star-szrComment #11
vijaycs85Re-roll + fix for #10 including follow up #2025719: Move drupal_add_css into hook_library_info() in block module
Comment #12
dawehnerFinal nitpick: There should be an empty line between the last two } } of a file.
Comment #13
vijaycs85Thanks for the review @dawehner. Updated Coding standard page to reflect this standard (https://drupal.org/node/608152/revisions/view/2686632/2739353).
Comment #14
dawehnerThank you very much!
Comment #15
alexpottWe should be return the same array as before... using drupal_add_css in a controller should not be done.
Comment #16
pguillard commentedComment #17
pguillard commentedI removed that changes to the patch.
Comment #18
helenkim commented#17: 1987636-convert_block_admin_demo-14.patch queued for re-testing.
Comment #19
pguillard commentedForgot to put the interdiff (My First git diff interdiff :-)) , here it is.
Comment #20
helenkim commentedCheck the #17's patch from #15. It looks O.K. Thanks you.
Comment #21
pguillard commentedrtbc ?
Comment #22
kim.pepperI found a bug.
Steps to reproduce:
Seems to be an issue with paths and the non-default theme.
Comment #23
kim.pepperFlagging as "needs tests" as this wasn't caught by the current tests.
Comment #24
ajits#4: drupal-convert_block_admin_demo-1987636-4.patch queued for re-testing.
Comment #25
ajitsChanged the status by mistake. Sorry.
Comment #26
ygerasimov commentedI see the issue with Seven theme and blocks demo described in #22 even without applying any patches. It is a separate bug.
Opened issue #2042879: Theme Seven has "Demonstrate block regions" broken. Shall this new issue be blocking this one? I believe so.
Comment #27
tim.plunkettI believe the bug described in #22 was resolved when I revamped the Block UI.
Anyway, here's a reroll with some fixes. The old patch didn't apply, so no interdiff.
Comment #28
jibranSome minor issues.
:S
Why are we depending on
theme.inc? We can easily write the logic here.This doesn't make sense. $request->attributes->get('theme') should be passed to function not $request according to route definition. Am I missing something?
Comment #29
tim.plunkett2 is definitely a good point. I'll sleep on 1.
Comment #30
tim.plunkettOkay, I did both of #28.
It turns out we had duplicate access checkers, so I simplified all of that.
Comment #32
tim.plunkettThank goodness for test coverage.
Comment #33
jibranWell now it looks nice and clear.
Comment #34
alexpottPatch no longer applies.
Comment #35
jibran3-way merge
Comment #36
vijaycs85+1 on RTBC.
Comment #37
jibranReplaced
twith$this->tinAdminControlleron @alexpott suggestion.Comment #39
disasm commented#37: drupal8.block-module.1987636-37.patch queued for re-testing.
Comment #40
dawehnerCan't we just check of if (\Drupal::request()->attributes->get(RouteObjectInterface::ROUTE_NAME) != 'block_admin_demo' ?
Comment #41
xjmThanks for your work on this issue! Please see #1971384-43: [META] Convert page callbacks to controllers for an update on the routing system conversion process.
Comment #42
disasm commentedComment #43
kgoel commentedComment #44
kgoel commentedDid reroll first and after bot passes than i will be working on fixes.
Comment #46
tim.plunkettI think you'll need to leave this until #1954892: Replace 'theme callback' and hook_custom_theme() with a clean theme negotiation system is in.
I think this can reasonably leave this as BlockController
Comment #47
kgoel commentedComment #48
jibranRemoval of this function from block.admin.inc file is missing.
Comment #49
kgoel commentedComment #50
jibranIt is good to go.
Comment #51
tim.plunkettThis is switched from check_plain to t(), why? Should probably be String::checkPlain
Wrongly capitalized H in THe
Comment #52
kgoel commentedComment #53
dawehnerThe feedback got adressed
Comment #54
alexpottLets check the route name here instead of path. This formulation looks fragile. I think the new if means that
$item['map'][4] == $themethen blocks will not be rendered... regardless of what is in$item['path'].Comment #55
tim.plunkettWe can just use the route name.
I also added tests, because we were missing a use statement, which caused the page to fatal.
Comment #56
neclimdulThis look questionable because we where ignoring the parameter but tim assured me we don't care and reviewing further that seems true.
This looks pretty straight forward. Back to RTBC with the assumption testbot comes back green.
Comment #57
alexpottCommitted c9e8fe3 and pushed to 8.x. Thanks!
Comment #58.0
(not verified) commentedUpdated issue summary.