I sporadically(?) receive the notice (often displayed twice) on a new (forum only) site.

Notice: Trying to get property of non-object in include() (line 25 of ...drupal-7.4/sites/all/modules/author_pane/author-pane-user-picture.tpl.php).

Whereas, there is mention of this notice in http://drupal.org/node/1086254, I thought I would create a new issue as this does not lead to WSOD and I have not noted any issues beyond the warning.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Slovak’s picture

In my instance, I am using a "User picture preset" option within advanced_forum settings. If a user profile is configured to use a default picture and the user hasn't uploaded one, AP appears to look for a non-existent image style and displays a broken image.

Scyther’s picture

Status: Active » Needs review
FileSize
814 bytes

This patch solves the problem.

Scyther’s picture

Status: Needs review » Closed (duplicate)
WorldFallz’s picture

Status: Closed (duplicate) » Reviewed & tested by the community
FileSize
902 bytes

Not sure why you closed this issue-- the non-object error is still present in the dev and it's not clear to me what it has to do with the other issue.

Here's a reroll for the current dev.

WorldFallz’s picture

oops... attached wrong file (previous patch doesn't add the base file system path).

Scyther’s picture

Status: Reviewed & tested by the community » Active

This issue here causes the other issue that is linked. So I decided to set this to duplicate.

Please do not set status to RTBC you own patches. It is not up to you to set that status.

I have not tested your patch, but what I can see already is that you have: <? variable_get('file_public_path', '') ?> So what if the site is using private filesystem? I think it would not work then.

I appreciate that you submit a patch for this issue, but I have a solution done already but I have not applied it yet. It will come in a few days.

Would have set this status to needs work, but I set it to active because I have the problem already solved, as I wrote.

Michelle’s picture

Just as an FYI, WorldFallz isn't some noob... Maybe I'm being an oversensitive busy body but she's done so much for the community and that just seemed a bit harsh... :)

Michelle

WorldFallz’s picture

@Scyther

It may be necessary for the other issue, but it's not sufficient-- so it's not a one to one. Either way it's a necessary patch to the current dev so it shouldn't be closed. I wasted over an hour tracking this down, after searching for an open issue, and only found it by accident after fixing it, creating a patch, and going to create a new issue. Had this been open I could have avoided wasting that time.

EDIT: oh and thanks for the lesson on RTBC -- i'm quite familiar with it. It was simply a click error ('needs review' is right next to RTBC).

@Michelle
Thanks for the kind words-- much appreciated. Frankly, if it hadn't been your module I'm not sure I would have even bothered. I'm getting quite sick and tired of the way this 'community' has been behaving lately. sheesh.

Michelle’s picture

Well, I'm not exactly a saint when it comes to responses in the issue queue... :) And I suppose that's probably hypocritical to step up when I see it aimed at someone I know. But that's just how it is sometimes, I guess...

Michelle

WorldFallz’s picture

Status: Active » Needs work

And the problem is not public or private-- user pictures are forced into a subdirectory of the files directory by the user settings so you can only have a private user picture if private files are set to a subdirectory of the files directory in which case 'file_public_path' will work fine in either case (i just tested to be sure).

The problem I only just noticed is the default picture can be a url-- then the patch doesn't work.

WorldFallz’s picture

Status: Needs work » Needs review
FileSize
1.17 KB

Ok, i've managed to fix it for my site. I'm not happy about using stripos to do it-- it's ugly, but it works.

Also note, that images outside of the drupal site can't be handled by theme_image_style, so if someone uses a large default image it doesn't get resized and can break the layout-- especially in a side bar. Not sure what you want to do about that. This patch just prints it anyway.

BeaPower’s picture

Does this work for anyone else?

wooody’s picture

Thanks , works with me.

rogical’s picture

#11 patch is not showing the correct default user avatar, as the the default user avatar doesn't have style images.

aa

Scyther’s picture

It should style the default avatar. How did you write the path to your default avatar? Do you have public:// or private:// included?

rogical’s picture

it's public, I put the author pane to panels, it has option to choose image styles for avatar.

when no image style chooosed, all display fine, when choose one style, avatars using default would not able to show.

Michelle’s picture

#15 is important. If you include those, imagecache (or whatever it's called in D7) gets confuseled and default avis don't work.

Michelle

blogook’s picture

Version: 7.x-2.x-dev » 7.x-2.0-alpha2

exactly same problem here
Notice: Trying to get property of non-object in function include() (line 25 in file ../sites/all/modules/author_pane/author-pane-user-picture.tpl.php).

I only get this message in forum postings of users that did not upload a user picture.

zuzu83’s picture

Hi

Same probleme #18, and #11 resolve probleme with me

RobLoach’s picture

Version: 7.x-2.0-alpha2 » 7.x-2.x-dev
Status: Needs review » Needs work

Instead of sticking this logic in the template system, we should have it in the preprocess function.

Scyther’s picture

Status: Needs work » Fixed

@Rob Loach - yes the logic should not be in the tpl.php file, now it is in the preprocces function.

If anyone is missing some variables in the tpl file please open a new issue with feature request for those variables.

Rewriten author-pane-user-picture.tpl.php file and rewriten preprocess function for it. This should solve this problem!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.