Download & Extend

Patch to work with module_grants

Project:Talk
Version:6.x-1.6
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I needed to use this module in conjunction with module_grants and I found I needed to make the following modification to the _talk_access() function in talk.module to allow the Talk tab to be visible on unpublished nodes.

/**
* Helper item for talk_menu: access callback.
*/
function _talk_access($node) {
  if (module_exists('module_grants'))    return ($node->nid && _talk_node_comment_value($node) && talk_activated($node->type) && user_access('access comments') && module_grants_node_access('view', $node) && (variable_get('talk_page_no_comments', TRUE) || $node->comment_count));
  else
    return ($node->nid && _talk_node_comment_value($node) && talk_activated($node->type) && user_access('access comments') && node_access('view', $node) && (variable_get('talk_page_no_comments', TRUE) || $node->comment_count));
}

Don't know if this sort of thing would be able to be included in future versions of Talk.