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.
I don't see why block module should be responsible for deleting the blocks created by menu module with function block_menu_delete. All of the other code having to do with menu module making blocks is in menu module.
This change was made in #473082: Add custom menu API but without any comment about the rationale there.
Comment | File | Size | Author |
---|---|---|---|
#11 | block-1019288-11.patch | 1.68 KB | tim.plunkett |
Comments
Comment #1
bleen CreditAttribution: bleen commentedNot sure if this should be in menu_delete() but for some reason I feel like having an implementation of hook_menu_delete seems more correct. Seems to separate the code better.
Comment #2
benjy CreditAttribution: benjy commentedThis no longer applies.
It also needs changing as I don't think we use "delta" anymore. See the new implementation in the block.module
Comment #3
zhuber CreditAttribution: zhuber commentedI've re-done this patch to work with the most recent changes in Drupal 8 core.
Please have a look and review when you can.
Comment #4
benjy CreditAttribution: benjy commentedGreat, thanks.
Comment #5
tim.plunkettThis could actually be
foreach (entity_load_multiple_by_properties('block', array('plugin' => 'system_menu_block:' . $menu->id())) as $block) {
Comment #6
benjy CreditAttribution: benjy commentedGood call. New patch attached.
Comment #7
BerdirHm. the menu blocks are provided by system.module, so it's not really clear to me what belongs in which module.
Comment #8
tim.plunkettUgh, yes, I always forget this. Which is part of why #2085243: Rename Menu module into Menu UI module needs to happen.
Comment #9
benjy CreditAttribution: benjy commentedAdded Tim's feedback from #5
Comment #10
tim.plunkettThanks!
Comment #11
tim.plunkettReroll
Comment #12
dawehnerSounds like a duplicate of #2031859: Invoke an event[s] when a plugin ID disappears tbh.
Comment #13
dawehner.