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.
It seems that "legacy" menu callbacks are gone as for this change notice: https://drupal.org/node/2106709 and we need to adapt all Devel ones (menu/reinstall, list fields, etc etc) so they use controllers.
In case of forms we need to extend FormBase & for the arbitrary pages, ControllerBase
Comment | File | Size | Author |
---|---|---|---|
#26 | devel-2108403-26.patch | 75.43 KB | pcambra |
#26 | interdiff.txt | 10.78 KB | pcambra |
#25 | devel-2108403-25.patch | 68.35 KB | tim.plunkett |
#25 | interdiff.txt | 31.46 KB | tim.plunkett |
#22 | 2108403-22-routing-devel.patch | 66.28 KB | joelpittet |
Comments
Comment #1
pcambraprogressing on this, let's see how much can I get done today
Comment #2
pcambraAlso our devel menu block is gone and "menu_name" in hook_menu has no effect for blocks now. Need to look into it.
Attaching the progress so far.
Comment #3
amateescu CreditAttribution: amateescu commentedHere's a review for the current work:
You can omit the title here and set it in the $form array with $form['#title'].
Paths should have a leading '/'. I know it's stupid, but that's the "rule" :(
Extra empty line.
Missing empty line :)
Comment #4
joelpittet@pcambra Are there plans to do the other components in here too or are those going to be on separate issues?
Comment #5
pcambraMy plan was everything here, feel free to jump in :)
Comment #6
joelpittet#2092529: [meta] Improve DX for defining custom routes this can cause some issues with if (module_exists('taxonomy')) {} in
function devel_generate_menu() {
Comment #7
joelpittetit's acctually this one:
#2091411: Provide an easier mechanism for a route definition wrapped by module_exists()
Here's more on that patch above, hope that helps a bit... not tested
Comment #8
joelpittetha whoops, xposted that. oh and did the nitpickery in #3 ;)
Comment #9
pcambraOh sorry, didn't realise that you meant devel generate with "other components", could you please move the devel generate patch to another issue?
It's a little too much for this one :\
Comment #10
wodzik CreditAttribution: wodzik commentedI've been working on this and here is my patch
Comment #11
wodzik CreditAttribution: wodzik commentedSorry. This patch is correct.
Comment #12
pcambraComment #13
wodzik CreditAttribution: wodzik commentedthere are only devel routes and callbacks to it
Comment #14
joelpittetMoved devel_generate to this one #2113659: Routing YAML for devel_generate
Comment #15
joelpittet@wodzik could do an interdiff between your changes and @pcambra patch in #2?
That way we can see what you changed?
Comment #16
joelpittetHere's the interdiff between #2 and #11.
Comment #17
pcambraNot sure what's the origin of all those tabs but please whoever got them in, check the coding standards and IDE settings.
Here's a patch to recover a little sanity, thanks for the work here @joelpittet & @wodzik
We've got a couple more to do (query log and user switch, seems) and I'll open a followup to recover the menu block with this stuff that got lost somewhere between https://drupal.org/node/2106709 and "menu_name" key in hook_menu()
Comment #18
pcambraAnd here we go, more WIP, devel switch conversion was a tough one.
Only these to go:
Comment #19
joelpittetI could be wrong but I was under the impression that the hook_menu needs the 'title' for the Menu Item titles?
Comment #20
pcambraI was thinking the same thing, but we've got _title in the routes in the yml file and @amateescu mentioned this in #3
So I guess 'title' is unwanted in hook_menu for some reason... I'll test it further before pushing to be really sure.
Comment #21
joelpittetThe only time you would remove 'title' from hook_menu items would be if it says type=>MENU_CALLBACK. And in that case you wouldn't need the item at all. I'm positive @amateescu is mistaken on that point.
#2047633: Move definition of menu links to hook_menu_link_defaults(), decouple key name from path, and make 'parent' explicit
Comment #22
joelpittetSome fixes and cleanup, added titles back in, fixed a couple route names, added title args back in. Removed menu items that were only MENU_CALLBACKs and fixed a couple typos/mistakes (menu_name was a route_name and one route had the wrong name in the menu item.
Comment #23
amateescu CreditAttribution: amateescu commentedYep, I didn't take into consideration that the 'devel/php' menu item was actually supposed to show up in a menu. I see now that that's the case, so 'title' needs to be kept in the menu link definition.
Comment #24
joelpittetThanks @amateescu for confirming:)
Missing start path
Comment #25
tim.plunkettFixed #24, and cleaned up in general.
Comment #26
pcambraSeems this got in #2048223: Add $account argument to AccessCheckInterface::access() method and use the current_user service so I changed that part.
Also #2013533: Replace hook_init by an event subscriber was needed to fix this one.
Not very fond of pushing unrelated changes in here, but we needed the clean up anyways... Pushed this to 8.x-1.x (final patch and interdiff attached)
Thanks @joelpittet @amateescu @tim.plunkett
Comment #27
salvisThanks all for this tough piece of work!
It would be nice to get a green patch before pushing though (if possible).
Comment #28
pcambraYeah we had all sort of problems with the testbot (see #2127283: Fix the tests (again)) and this got in a couple of days ago, now we're back in green and hopefully we won't need to rewrite more big chunks of code to keep the pace of HEAD.