Closed (fixed)
Project:
Widgets
Version:
7.x-1.0-beta5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2012 at 04:01 UTC
Updated:
4 Sep 2012 at 00:52 UTC
Jump to comment: Most recent file
Comments
Comment #1
TomDude48 commentedCan you tell me the path of the page you were on?
Comment #2
pverrier commentedI have the same kind of notice in another context :
" Notice : Trying to get property of non-object dans widgets_get_context_author_uid() (ligne 1300 dans C:\wamp\www\rdj3\sites\all\modules\widgets\widgets.module). "
I created some views in order to show data in a "user space" : /user/%/publications (list of the nodes he published), /user/%/comments, and so on (where % is a UID).
I have this notice only in these pages, the concerned code being :
especially line 1300 because
arg(0) == 'user' && is_numeric(arg(1))is true, andmenu_get_object('user', 1)is null in this context.I think something is missing here :
Since the user object seems to be loaded in other contexts than user/% (like user/%/socialmedia), the second solution is better.
In my case, directly using arg(1) instead of menu_get_object() would do the trick, but I think it's better to implement my special needs in the alter function.
I suggest a patch below, also covering the node context case few lines above. Perhaps will be a solution for @flock since widgets_build_cache_cid() calls widgets_get_context_author_uid() (?)...
Comment #3
dddave commentedCorrecting status (don't have the issue btw).
Comment #4
vaibhavroys commentedwhere should i paste this patch please give a brief explanation
.
Comment #5
dddave commentedHere is a good tutorial about applying patches: http://drupal.org/node/620014
Comment #6
pverrier commentedI made the first patch with svn.
This one is made with git on current dev version.
Comment #7
pverrier commentedModified file from beta5 will be easier to use directly...
Comment #8
rsvelko commentedthe patch from #6 fixed it for me. D7, php 5.3
the patch code seems quite logical.
Comment #9
TomDude48 commentedpatch applied. Thanks pverrier!
Comment #10
pverrier commentedYou're welcome! :)
Comment #11
TomDude48 commentedNo more error reports, assuming fixed.