Blank browser screen when going to Menu Trails admin page
| Project: | Menu Trails |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Jump to:
After installing and enabling Menu Trails on Drupal 6.10, I get a blank browser window when I try to go to
http://tap.resultsfordevelopment.org/drupal/admin/settings/menutrails
I'm assuming there is some kind of php error. Also when viewing pages on the site I get the following error.
"warning: Invalid argument supplied for foreach() in /home/www/tap.resultsfordevelopment.org/drupal/sites/all/modules/menutrails/menutrails.module on line 130."
I tried commenting out the following lines from menutrails.module. The warning I received on front end pages went away, but the blank screen for the admin page still occurs.
// foreach ($node->taxonomy as $term) {
// if ($term_trails[$term->tid]) {
// $href = $term_trails[$term->tid];
// }
// }Any assistance in pinpointing the cause of the problem would be greatly appreciated.

#1
There are a couple of bugs caused by Menutrails unfortunately assuming the presence of the Taxonomy module, so when it's not things go bang. The admin screen blows up on 252 for a similar reason.
I've made a fix by:
<?phpif ($node->taxonomy) {
foreach ($node->taxonomy as $term) {
if ($term_trails[$term->tid]) {
$href = $term_trails[$term->tid];
}
}
}
?>
<?phpif (module_exists("taxonomy")) {
$vocabs = taxonomy_get_vocabularies();
}
?>
$vocabscan be empty:<?phpif ($vocabs) {
foreach ($vocabs as $vocab) {
if ($vocab->tags != 1) {
// tagging gets out of hand too fast, so we disallow
$form[$vocab->vid]['menutrails_terms'] = array(
'#tree' => TRUE,
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#title' => t('Categories:') ." $vocab->name",
);
$terms = taxonomy_get_tree($vocab->vid);
foreach ($terms as $term) {
$form[$vocab->vid]['menutrails_terms'][$term->tid] = array('#type' => 'select',
'#title' => t('Parent item for') ." $term->name",
'#default_value' => $term_trails[$term->tid],
'#options' => $options,
);
}
}
}
}
?>
After the above 3 checks are added, there are no more problems for me.
Jim
#2
Ahhh bugger. I spotted the above is already reported (and fixed in dev) in #313556: Missing dependency declaration for taxonomy module just after I posted the above.
#3
Sorry for the delayed response. I implemented the dev version and now it works fine. Thanks for saving my day and thanks to Josh K for fixing the problem!!
#4
subscribing