Closed (won't fix)
Project:
Statistics Advanced
Version:
6.x-1.4
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2008 at 20:46 UTC
Updated:
28 Jul 2009 at 21:03 UTC
Not sure if this is a Content Template or Statistics Advanced Settings problem but this is the white screen of death (WSOD) error I get when I go to use the create template link on a page with many CCK fields.
Fatal error: Cannot use object of type stdClass as array in .../sites/all/modules/statistics_advanced/statistics_advanced.module on line 111
Disable Statistics Advanced Settings, and the problem goes away.
Version Info
Core 6.5
Statistics Advanced Settings 1.2
Contemplate 0.16
I got this error with the previous version of Contemplate, so this is nothing new as far as I know. It was fairly low on my priority list, since I have a workaround (disabling statistics advanced settings).
Comments
Comment #1
Garnerin commentedI was encountering the same 'fatal error' with the same versions.
But I think that the question is misleading how many CCK fields the content type contains. I can reproduce the error message also with standard types without CCK fields, i.e. with "page", "blog", "image" and "poll", but not with "story" or "forum".
Comment #2
jrglasgow commentedmy opinion is that it is the Statistics Advanced Settings advanced settings module, at least looking at the fatal error you are receiving that's what it looks like
Comment #3
Garnerin commentedThus I've created an appropriate issue at Statistics Advanced Settings (#321969: Fatal Error with Statistics Advanced Settings & ConTemplate) referring to this discussion here. However, I'm still not sure which of both modules needs to be reworked in order to be compatible to the other one.
Comment #4
dave reidCross-posting what I wrote in #321969: Fatal Error with Statistics Advanced Settings & ConTemplate:
I had this issue reported before and it's not the Statistics Advanced module at fault. See #318877: Cannot use object of type stdClass as array. Re-looking at that issue I'm guessing that they were also using Contemplate. To summarize that issue's findings:
What kind of variable is Contemplate providing for the links array?
Comment #5
dave reidLooking into the code. From core's node.module:
Latest contemplate:
I don't see any reason for this function not to follow core, and this may be the problem. There is additional checking done in drupal_alter.
Comment #6
jrglasgow commentedThe proper way to remove the links from the node display you need to adjust the node template in node.tpl.php for the theme
Comment #7
dave reid@jrglasgow: That's not true. We're talking about removing one of the node links, and not all of them. That's the whole purpose of the hook_link_alter. It's how core's translation module modifies/removes links:
And also core's forum module:
Comment #8
dave reidI'll load up a working version of the Contemplate module tonight so I can test #6, but has anyone else tried replacing the contemplate_node_view code with the code from node_view yet to see if this fixes the issue?
Comment #9
Flying Drupalist commentedI'm not using Contemplate, but panels and I'm getting this.
Comment #10
Ben Holmes commentedI don't use "Content Templates", but I did install the advanced statistics today - and the error popped up. Disabling the module cures the problem
Comment #11
dave reidOk moving back to Statistics Advanced. This is really frustrating since obviously some other module is messing up a completely valid hook implementation...
Comment #12
marcus0263 commentedI don't use "Content Templates" either and I'm having the same error with "Statistic's Advanced"
Comment #13
chuckdeal97 commentedI had this same problem. In my case, I was using the usercomment module and it had coded the link_alter call incorrectly (reversed the parms). See #337405: hook_link_alter call was incorrect for a patch to usercomment (for those of you using it).
Comment #14
Apollo610 commentedHad my hopes up, Chuck, until I realized that I'm not using that module. :/
I'm receiving this error as well, as soon as I flip Advanced Stats on... however, after some testing of flipping various modules off, I find that turning "Advanced Forum" off gets rid of the error and allows me to hit the (forum) node that was causing fits.
Has anyone looked at this adv forum module as a possible culprit? I'm not much of a php coder otherwise I'd dive in myself.
Comment #15
Apollo610 commentedActually, I just took a look at advanced_forum.module and it looks like the same issue Chuck described above applies here as well.
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);
Making this change gets rid of the error. I also added a bug report to the Advanced Forum project to get this fixed up on that side.
Comment #16
dave reidThanks for all the detective work Apollo16 and chuckdeal97!
Keeping track of all the modules that need to be fixed:
Advanced Forum: #337457: Incorrect implementation of link_alter
User Comment: #337405: hook_link_alter call was incorrect
Forum Thread: #343486: Incorrect implementation of link_alter
Contemplate: #349970: Incorrect implementation of link_alter
Panels: #349979: Incorrect implementation of link_alter
Comment #17
dave reidSo I checked out EVERY contrib module from CVS today so I could search them. Here's the results for modules which probably contain the incorrect implementation:
Comment #18
dave reidMarking this back as 'won't fix' and I'll keep updating my post #16 with the issues from other modules so we can track when they are fixed.
Comment #19
lameei commented+1
Comment #20
cgjohnson commentedI have this issue and also am not using contemplate, but am using xml sitemap and the Forums and Statistics that ship with 6.9 core. Thanks.
Comment #21
dave reid@cgjohnson Are you using any other contrib modules? Any of the ones listed in #17?
Comment #22
angelopc commentedIt told me to report, so I'm reporting.
Error message:
* Invalid parameters for hook_link_alter(). Please report this message to http://drupal.org/node/321295.
line 641 in /home/xxxxxx/public_html/sites/all/modules/contemplate/contemplate.module (contemplate_node_view)
line 668 in /home/xxxxxx/public_html/sites/all/modules/contemplate/contemplate.module (contemplate_node_views)
* Invalid parameters for hook_link_alter(). Please report this message to http://drupal.org/node/321295.
line 643 in /home/xxxxxx/public_html/sites/all/modules/contemplate/contemplate.module (contemplate_node_view)
line 668 in /home/xxxxxx/public_html/sites/all/modules/contemplate/contemplate.module (contemplate_node_views)
Using Content Templates (Contemplate) 6.x-1.0
Comment #23
nguyenquocviet commentedMe too, It told me to report below error, It was happening when I clicked on a content type to see their variables:
Invalid parameters for hook_link_alter(). Please report this message to http://drupal.org/node/321295.
line 641 in /home/thinghie/test/sites/all/modules/contemplate/contemplate.module (contemplate_node_view)
line 668 in /home/thinghie/test/sites/all/modules/contemplate/contemplate.module (contemplate_node_views)
Invalid parameters for hook_link_alter(). Please report this message to http://drupal.org/node/321295.
line 643 in /home/thinghie/test/sites/all/modules/contemplate/contemplate.module (contemplate_node_view)
line 668 in /home/thinghie/test/sites/all/modules/contemplate/contemplate.module (contemplate_node_views)
I am using
Drupal 6.10
contemplate-6.x-1.0
statistics_advanced-6.x-1.4
Nguyen Quoc Viet
Comment #24
i.chris.jacob commentedThis worked for me...
$node->links['faq_view_comments_link'] = array(
'title' => t('View comments'),
'href' => "node/$node->nid",
'fragment' => 'comments',
'attributes' => array('title' => t('View comments')),
);
Takes me to:
id="comments"
Pathauto paths are maintained. (i.e. outputs /some-subcategory/some-page-title#comments rather than /node/55#comment).
Comment #25
dave reid@angelopc @nguyenquocviet Contemplate's bug has been fixed in the 6.x-1.x-dev version. If you upgrade to that contemplate version the errors will go away.
Comment #26
danielcala commentedI found this problem on my website:
Invalid parameters for hook_link_alter(). Please report this message to http://drupal.org/node/321295.
line 65 in /home/beta/public_html/sites/all/modules/panels/content_types/node_content.inc (panels_admin_node_content)
line 229 in /home/beta/public_html/sites/all/modules/panels/includes/plugins.inc (panels_content_node_content)
I am using
Drupal 6.12
statistics_advanced-6.x-1.5
Panels 6.x-2.0-alpha3
I don't have contend template installed
Comment #27
dave reidThanks danielcala: I filed an issue with panels at #533770: Incorrect implementation of link_alter