Posted by Microbe on October 17, 2008 at 12:44pm
| Project: | Family Tree |
| Version: | 6.x-1.0-beta1 |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Ascendants and Descendants tabs appear on every node type they should only appear on family_individual nodes.
Comments
#1
Fixed - access callback checks node type before loading the tabs.
<?php
$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;
}
?>
--project followup subject--
Automatically closed -- issue fixed for two weeks with no activity.
#2
Automatically closed -- issue fixed for two weeks with no activity.
#3
Has this been committed to CVS?
#4
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
#5
Committed http://drupal.org/node/339265#comment-1128891 to CVS.
#6
Automatically closed -- issue fixed for two weeks with no activity.