Posted by soedib on March 6, 2009 at 11:04am
Jump to:
| Project: | Taxonomy menu |
| Version: | 5.x-1.05 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
After upgrading from 5.x-1.03 to 5.x-1.04 I get a syntax error "unexpected T_OBJECT_OPERATOR in .../taxonomy_menu.inc on line 240" on most site pages, the whole site becomes unusable. I suspect this is due to the PHP version my hosting provider uses (PHP 4.4.8), since I don't have that issue on a local test site with PHP 5.2.5 running on it.
The code in question:
<?php
$breadcrumb_items = array('path' => $path, 'title' => t(taxonomy_get_vocabulary($vid)->name)) +
_taxonomy_menu_get_term_breadcrumb_items($vocab[0], $path) +
array('path' => 'node/'. $node->nid, 'title' => $node->title);
?>May be the same issue as in http://drupal.org/node/155176.
Regards,
soedib
Comments
#1
You could try changing
<?php$breadcrumb_items = array('path' => $path, 'title' => t(taxonomy_get_vocabulary($vid)->name)) +
_taxonomy_menu_get_term_breadcrumb_items($vocab[0], $path) +
array('path' => 'node/'. $node->nid, 'title' => $node->title);
?>
to
<?php$getvid = taxonomy_get_vocabulary($vid);
$breadcrumb_items = array('path' => $path, 'title' => t($getvid->name)) +
_taxonomy_menu_get_term_breadcrumb_items($vocab[0], $path) +
array('path' => 'node/'. $node->nid, 'title' => $node->title);
?>
I haven't tested this as I don't have any php 4.x available but it might well work
#2
Thanks' hutch. I'll add this to the CVS today.
#3
Can you please try out the latest Dev and let me know if this fixes the issue? If so then I will make a stable package.
#4
Hey, thank you for your fast reaction. But no, sorry, this doesn't fix the problem, though this variant of the code apparently triggers the error less frequently. Now Drupal chokes on only on 1/4th or so of the pages .
Instead of the initially reported error line, I now get "unexpected T_OBJECT_OPERATOR...on line 239". Hope this is of any help.
#5
in taxonomy_menu.inc,v 1.1.2.12 2009/03/07 12:14:48 (in cvs)
$getvid = taxonomy_get_vocabulary($vid)->name;$breadcrumb_items = array('path' => $path, 'title' => t($getvid->name)) +
should be
$getvid = taxonomy_get_vocabulary($vid);$breadcrumb_items = array('path' => $path, 'title' => t($getvid->name)) +
that should fix it ;-)
Actually calling it $getvoc instead of $getvid would make it more readable but not important
#6
Sorry for that. New version has been committed.
#7
Hmm. Thanks for your efforts, but I've still problems. After applying the renewed patch, I got "unexpected T_OBJECT_OPERATOR ... on line 258".
Suspecting a similar issue, I changed
<?php$tree = taxonomy_get_tree(taxonomy_get_term($tid)->vid);
?>
to
<?php$termtid = taxonomy_get_term($tid);
$tree = taxonomy_get_tree($termtid->vid);
?>
but this lead to
Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in .../includes/menu.inc on line 356Did I do something obviuosly stupid?
Regards,
Soedib
#8
Automatically closed -- issue fixed for 2 weeks with no activity.
#9
same error here using php4 & Taxonomy Menu 5.x.-1.05.
1.03 was the last working version for me, so i reopen this issue.
TSE
#10
5.x-x.x no longer avtively supported (and php4 is on its way out too, IMO).