Ascendants and Descendants tabs appear on every node type they should only appear on family_individual nodes.

CommentFileSizeAuthor
#1 family.module.txt10.48 KBMicrobe

Comments

Microbe’s picture

Status: Active » Fixed
StatusFileSize
new10.48 KB

Fixed - access callback checks node type before loading the tabs.

          $items['node/%/tree/asc'] = array(
	      'title' => 'Ascendants',
            'page callback' => 'family_view_tree_asc',
            'page arguments' => array(1),
            'type' => MENU_LOCAL_TASK,
            'access callback'   => 'family_individual_check_type',
            'access arguments' => array(1),
	  );
	  $items['node/%/tree/desc'] = array(
	      'title' => 'Descendants',
            'page callback' => 'family_view_tree_desc',
            'page arguments' => array(1),
	      'type' => MENU_LOCAL_TASK,
            'access callback'   => 'family_individual_check_type',
            'access arguments' => array(1),
	  );
   return $items;
} // function family_menu()

function family_individual_check_type($nid){
  if(is_numeric($nid)){
    $node = node_load($nid);
    if($node->type == 'family_individual'){
      return TRUE;
    }
  }
  return FALSE;
}
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

pyutaros’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

Has this been committed to CVS?

Microbe’s picture

No, use my latest upload of family module http://drupal.org/node/339265#comment-1128891 which also includes the brith misspelling fix and mysql_fetch_array fix as well as this fix

pyutaros’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.