When using both ADV Forum and ADV Statistics, I received the following error:
Fatal error: Cannot use object of type stdClass as array in .../sites/all/modules/statistics_advanced/statistics_advanced.module on line 111
Turning off either ADV Statistics or ADV Forum would resolve this - however I need both for my site.
Following this thread ( http://drupal.org/node/321295#comment-1119902 ) I was able to resolve the problem by making a small change in the advanced_forum.module.
Old:
foreach (module_implements('link_alter') as $module) {
$function = $module .'_link_alter';
$function($node, $links);
New:
foreach (module_implements('link_alter') as $module) {
$function = $module .'_link_alter';
$function($links, $node);
I'm new to the whole Drupal community so I'm unsure how to formally submit a formal "patch", but this update seems to fix the problems I was having.
Comments
Comment #1
dave reidModule maintainer of the Statistics Advanced module here. I've confirmed that this is the wrong way to implement hook_link_alter. The correct implementation is:
Comment #2
dave reidRenaming title. Also see that the D6 version of hook_link_alter expects the parameters to be $links, $node, and the D5 version of hook_link_alter expects the reverse, $node then $links.
Comment #3
michelleI copied that code from somewhere here on d.o a very long time ago and never really looked at it that close so it wouldn't surprise me if it was wrong. :)
I'm travelling right now but will take a look at it when I get back.
Thanks,
Michelle
Comment #4
michelleOk, I dug into it and what happened was that I had copied the code from the node module in D5. When I ported to D6, I didn't realize the code had changed and it didn't give me any problems. I looked at the new node_view code and it matches what you have there so I committed it.
Thanks,
Michelle
Comment #5
dave reidSweet! Thanks Michelle!
Comment #6
michelleNo problem. Thanks for letting me know. I guess I don't have any modules that alter the links in the D6 version of my test site. One of the downsides of porting this module long before I'm actually using D6 myself. It doesn't get any real world testing by me.
Michelle