This has come up specifically in a thread about the nodecomments module. Revisioning overrides the callback for 'node/%' preventing nodecomments from rendering properly

http://drupal.org/node/477518#comment-2948320

It's been noted that revisioning fallbacks to original node module page callback (last line in the code below) where as it could invoke another's callback (like nodecomments)

<?php
function _revisioning_view($node) {
  if (_revisioning_load_op($node, 'view') == REVISIONING_LOAD_LATEST) {
    $vid_to_load = revisioning_get_latest_revision_id($node->nid);
    $node = node_load($node->nid, $vid_to_load);
  }
  // In node.module, node_page_view() is used to display the current, while
  // node_show() is used for any other revision. The difference between the
  // two is that node_page_view() surpresses the message that tells us we're
  // viewing a revision. That's what we use here because we have our own
  // configurable message.
  return node_page_view($node);
}
?>

Comments

rdeboer’s picture

Assigned: Unassigned » rdeboer

Ok.
I feel I may be able to help you out.
Watch this space.

locomo’s picture

thank you! this would be a huge help!!

crea’s picture

Note that simply recording page callback and invoking it wouldn't always work. Tricky part is callbacks also can have different arguments.

locomo’s picture

friendly bump - still think this is possible?

rdeboer’s picture

Really sorry but currently snowed under...

locomo’s picture

I understand - for my own planning purposes could you offer a ballpark time frame (week, month, year) for when you might be able to look at this? Thank You.

rdeboer’s picture

I'll assess this weekend and will get back to you.

locomo’s picture

much appreciated - thank you

locomo’s picture

just checking in :)

rdeboer’s picture

Darn... still haven't had time to look at this one.... sorry.

locomo’s picture

thanks RdeBoer ... i understand how it is!

any chance you could sketch out for me conceptually what has to happen? .. i'm just slowly getting my head around module development, but i'm willing to give this a crack.. but i could use a little help to get started

thanks!

locomo’s picture

friendly bump - hoping to keep this on the radar

locomo’s picture

Hey there.. any chance this will get addressed or should it just be "won't fixed"?

rdeboer’s picture

Holy moly... it's been 5 months....
The will is there, but the time is not....

locomo’s picture

haha.. ok ... will is a good place to start :)

achton’s picture

This is also an issue for anyone utilizing the node_view Panels Page, which overrides the node/%node path.
Therefore, important by my standards :)

Any news?

scottrigby’s picture

Version: 6.x-3.9 » 6.x-3.11

It'd be nice to use Revisioning with PURL :)

@RdeBoer: Would you consider something like something like Chain Menu Access API?

rdeboer’s picture

@scott, #17
Chain menu API looks like the way to go. Thanks for pointing it out to us! I hope to have some time later this month for this and some porting work.

sellsjello’s picture

I'm also anxiously awaiting a nodecomments compatible revisioning module. Thanks for all your hard work!

locomo’s picture

thanks RdeBoer - really hoping to be able to integrate nodecomments in 2011 :)

happy to help testing or otherwise!

aenw’s picture

I'm also running into this problem. I need to use Revisioning and also Node Comments.
Any progress? Any testing I can help with or info I can provide on my configuration?

rdeboer’s picture

I will look into this this weekend....

rdeboer’s picture

Sorry I need a bit more time. Hopefully next weekend.

cmidgley’s picture

To get around this for now, I created a module with a heavier weight than either nodecomment or revisioning. In that module, I used hook_menu_alter to override node/% to point to a new implementation that merges both of their functions into a single implementation. It's not the best answer, but works for me. Here is the key fragment (obviously replace MODULE with your module name, and don't forget to change the module weight):

/**
 * Implement hook_menu_alter - to override the node/% callback when both node comment and revisioning are used, because
 * they conflict with each other.  This version merges the code from each of them into a unified view.
 */
function MODULE_menu_alter(&$items) {
	// are we using both node_comment and revisioning?  If so, change the node/% callback to point to us
	if (module_exists('nodecomment') && module_exists('revisioning'))
	    $items['node/%node']['page callback'] = 'MODULE_node_view';
}


/*
 * Implement a version of node_view (called on all node/% pages) that merges the logic of nodecomment and revisioning
 * to resolve a compatibility issue they are having.  Only used when both modules are enabled.
 */  
function MODULE_node_view($node, $cid = NULL) {
  if (_revisioning_load_op($node, 'view') == REVISIONING_LOAD_LATEST) {
    $vid_to_load = revisioning_get_latest_revision_id($node->nid);
    $node = node_load($node->nid, $vid_to_load);
  }
  
  drupal_set_title(check_plain($node->title));
  $output = node_page_view($node, FALSE, TRUE);

  if (!empty($node->comment)) {
    $output .= comment_render($node, $cid);
  }
  else if (!empty($node->node_comment)) {
    $output .= nodecomment_render($node, $cid);
  }

  // Update the history table, stating that this user viewed this node.
  node_tag_new($node->nid);

  return $output;
}

Hope this helps...

- Chris

rdeboer’s picture

@ #24
Thanks for all this Chris.
Sorry I didn't get round to spending any time on it so far.
Rik

rdeboer’s picture

Status: Active » Closed (won't fix)

Looks like Chris' solution in #24 does the job with any change necessary to Revisioning.