Closed (fixed)
Project:
Marinelli
Version:
7.x-3.0-beta11
Component:
User interface
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Jan 2011 at 07:24 UTC
Updated:
31 Jul 2013 at 18:35 UTC
In what has otherwise been a wonderful experience with the new installation (www.metal-hq.com), me and other users
(including anonymous users) get the following error in an unmissable bright red box! This error happens typically when a user
visits a blog entry and then goes one level up - back to the home page, for example.
I'm a newbie but have built usable drupal sites before without getting into too much of php and such... kindly tell me what I
should do to correct this problem:
Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 187 of /home/metalhqc/public_html/sites/all/themes/marinelli/template.php).
Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 187 of /home/metalhqc/public_html/sites/all/themes/marinelli/template.php).When I look for the offending line, the relevant block of code reads from line 182-188 like this. Line 187 is second last from below.
function marinelli_preprocess_comment(&$vars){
$vars['classes_array'][] = $vars['zebra'];
$account_uid = $vars['content']['comment_body']['#object']->uid;
$comment_author = user_load($account_uid);
$user_image = image_get_info(image_style_path(variable_get('user_picture_style'), $comment_author->picture->uri));
$vars['image_width'] = $user_image['width']+25;
Help, anyone?
Comments
Comment #1
mavimo commentedComment #2
mavimo commentedPlease try to replace function marinelli_preprocess_comment with:
Comment #3
mavimo commentedComment #4
narayan kumar commentedThanks for taking the time to help. The problem is gone! Wow, indeed.
Comment #5
Carl242 commentedHi. I replaced the code as written above, but the error changed. I now get:
Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 186 of /home/yourspa4/public_html/_sites/microcarusa/sites/all/themes/marinelli-7.x-3.0-beta4/marinelli/template.php).Also, I notice that the username does not show up in the comment field (probably will make a new ticket for that, but something tells me it might be related).
Thanks for the help, and for the awesome theme!
Comment #6
Lioz commentedComment #7
novakov commented#2 didnt worked for me, same errors (only in admin section and all seems to be working)
Comment #8
badre commentedSame problem with red box:
Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 186 of /var/www/drupal7rc4/sites/all/themes/marinelli/template.php).Comment #9
badre commentedsorry first time registered - for beta 4 status not fixed
Comment #10
ThumbsUpDavid commentedI'm having this same problem as well...#2 did not change anything, either.
Comment #11
sammyframson commentedI'm having the same issue and #2 didn't work for me either. This is actually not a new install either. I have had the theme installed with no issues for about a week and this issues just appeared yesterday.
Error:
Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 186 of /.../sites/all/themes/marinelli/template.php).
Comment #12
mavimo commentedreplace function marinelli_preprocess_comment with:
let us know if it work.
Comment #13
jpuchalski commentedI applied the fix shown above after having seen the same error. It seems to have solved the problem in my case. I ran into the issue while creating forum posts. I'm using:
WYSIWYG 7.x-2.0
IMCE Wysiwyg API bridge 7.x-1.x-dev
IMCE 7.x-1.1
CKEditor 3.5
Hope this helps
Joe
Comment #14
marta_yo commented#12 works for me, thanks!
Comment #15
sammyframson commentedI haven't seen this error in some time. It appears to have been fixed with the update from number 2...
Comment #16
Lioz commentedComment #18
jimpanse commentedI get the same error if user use the search function.
If a user has a profile picture it works without an error.
Without a picture I'll get the red error box:
And with the "Patch" i'll get this error:
Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 196 from /mnt/web4/12/90/52037890/htdocs/sites/all/themes/marinelli/template.php).Comment #19
Daedalon commentedJimpanse, try updating to Marinelli 7.x-3.0-beta11. If you get errors after that, please see this patch that fixed them for me.
Comment #20
gerguaigua commentedYo resolví el error con el post 12. En Versión 7.x-3.0-beta11
Comment #21
MDV commentedPerfect! the code that post mavimo, works perfect for me, thank you!!
Comment #22
manoloka commentedI confirm that #12 also fixed my issues
Thanks