If the load functions result in 404 we change the router item into FALSE which destroys the delivery callback -- essentially we can't deliver a not found in anything but HTML.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | deliver_callback_keep.patch | 3.01 KB | chx |
| #11 | deliver_callback_keep6.patch | 3.65 KB | berdir |
| #9 | deliver_callback_keep5.patch | 3.65 KB | berdir |
| #7 | deliver_callback_keep4.patch | 3.29 KB | berdir |
| #5 | deliver_callback_keep3.patch | 3.28 KB | berdir |
Comments
Comment #1
chx commentedComment #3
berdirPatch didn't work because we kept $store, which did not contain the unseralized page/theme_arguments.
Adjusted the patch slightly to simply use $map to conditionally put the $router_item into $router_items.
Comment #4
berdirUps, that contained debug code.
Comment #5
berdirI guess it would be good to add a test for this, I'm not sure if I fully understand it. This is only for the case when there *is* a router item, right? Obviously, when there isn't, there can't be a delivery callback stored with it :)
Anyway, I was wondering if there is a way that allows to do this without requiring another drupal_static() array and those internal arguments...
- What about returning the router_item with 'map' and access set to FALSE in the case when $map is FALSE? We need a additional check in menu_execute_active_handler() then but everything else should then work correctly.
- I also think we can drop the first internal argument of menu_get_item() if menu_set_item() directly injects the router item into the drupal_static() cache. We use that pattern (sharing static cache between multiple functions) in other instances too. I'm putting this in the same patch to test it, we can easily do this in a separate issue.
Comment #7
berdirFixed the patch in #5.
Comment #9
berdirAdded the same check ($item['map'] to menu_tree_page_data(). Maybe the api change is too big... Anyway, the patch in #4 is still a valid solution too.
Comment #11
berdirAnd now with the correct braces...
Comment #12
chx commentedDon't change the return value of menu_get_item() this late. That's a non-starter I am afraid. I like #4 but it changed the strict checking against FALSE to an empty. I rerolled with strict checks. And a test would be good yes.
Comment #20
nightowl77 commentedSubscribe. Want to test this when I get a moment