Closed (duplicate)
Project:
File Framework
Version:
6.x-1.0-alpha2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Oct 2008 at 04:43 UTC
Updated:
18 Oct 2008 at 16:56 UTC
Fatal error: Cannot use object of type stdClass as array in /var/www/blahdeblah.com/sites/all/modules/statistics_advanced/statistics_advanced.module on line 111
...happens when trying to create template for content type File (module File Framework), via http://blahdebleh.com/admin/content/templates/file
Comments
Comment #1
dave reidThe offending code is in my implementation of hook_link_alter which follows the specification completely:
Somehow, the $links parameter is being passed as an object, which is not the correct way to be using the hook. I don't see how the statistics_advanced module is in error here. I'm passing this issue to the file framework project and I'll see if I can find somewhere in this massive code where it's going wrong...
Comment #2
dave reidakwala, what version of file framework are you using? It looks like there may be some differences in checking array-types for $links between the 6.x-1.x-dev and 6.x-1.0-alpha2 versions. If the file framework module maintainer (miglius) thinks that the 6.x-1.x-dev version is safe for normal use, I'd probably recommend using that version.
Comment #3
miglius commentedThe fileframework is still under heavy development, optimization, bug fixes. Dev version is much more mature than the alpha2. I'm trying to keep dev as stable as possible so I would recommend using it. But of course not everybody can use dev versions in the production.
Comment #4
akwala commentedI'm using 6.x-1.0-alpha2 -- am also correcting it in the Version field of this issue.
--aslam
Comment #5
dave reidakwala, are you using Contemplate?
Comment #6
miglius commentedWhy do you think it is a FileFramework related issue? I have installed the Contemplate and Statistics Advanced Settings modules, enabled them, then went and successfully created a template for the file node, but didn't get the error you mentioned.
It does not matter that you're creating a file node template, but all modules which implement hook_link() can screw the $links variable. Since I don't know your setup, I can only recommend debug your system, i.e., trace all invocations of the hook_link() and the variable $links which is passed to all hooks and find which module changes the type from the array to the object.
Comment #7
dave reidHey, we're just trying to figure out where the problem is. If we need to bounce between several projects, that's no problem.
Comment #8
akwala commentedYes, I am using Contemplate 6.x-0.16
--aslam
Comment #9
akwala commentedShould've probably checked this earlier...
This happens with the following content types:
- blog entry
- file
- forum topic
- book page
- page
It doesn't happen with the following content type:
- story
Those are all the content types I use. let me know if there is any particular difference between the 2 sets that I should look for.
--aslam
Comment #10
dave reidThis looks to be a problem with the Contemplate module and it's handling of node links. We're tracking that issue in #321295: Errors when other modules incorrectly implement link_alter. I'm going to mark this as a duplicate since we've narrowed down to the correct module.