I have a use case where I want to display the exact view of a node on it's revision page. I use panels for my node view, and through #515518: Optional node revision task handler to override default behavior I've found a sandbox project (https://drupal.org/sandbox/damienmckenna/1821404) which overrides the revision callback to show the same thing as the node view panel which works great.

The only problem is that my node view panel uses a menu block and in menu_tree_build() there's a database query (line 269) which explicitly passes in $_GET['q'] which will never exist for a path like "node/2078/revisions/24340/view". If I change the $_GET['q'] to the node/nid path then everything works perfectly and my menu block is displayed on my revisions page.

Is there any way we can allow this functionality without such a hack? There's some fairly flexible ways we could do this like using a db_select and adding a tag so that custom modules can easily use hook_query_alter to change the query, but there's also the cruder approach of detecting the revision path and adjusting accordingly. I'm really after some good suggestions to get around this without hacking the module so would appreciate some feedback

Comments

acbramley’s picture

Status: Active » Closed (fixed)

Looks like this is fixed with the new logic in --dev

acbramley’s picture

Status: Closed (fixed) » Active

This could have been a false positive before, or perhaps menu_block has changed again, but the same query is present just in another function:

menu_block_get_current_page_menu()

However, the same hack/workaround that worked before nolonger works. Further investigation required to determine where the data is not being returned.