To put it simply, I enabled the latest dev version of this module, set the block to appear on articles and attempted to navigate to an article - I got the WSOD.

I'd like to give you further information but I'm not sure what is relevant, so please ask.

Comments

gordon’s picture

Status: Active » Postponed (maintainer needs more info)

you will need to tell me the error, If you can take a look in your system log and tell me the error I will be able to resolve it.

Shadlington’s picture

Title: WSOD » WSOD when user picture preset assigned
Status: Postponed (maintainer needs more info) » Active

Sorry about that - I would have told you the error if there was one. I expected an error but nothing showed up in my log (and still doesn't on repeated attempts).

That said, I played with it again and it turns out it was only happening when I set the 'User picture preset' option on the block (to anything other than blank).
Hopefully that will give you a better indication of what's going on.

Shadlington’s picture

It seems as if the default user picture is the problem.
The problem was only happening when showing a post by someone with a default user picture instead of their own.
If I don't set a user picture preset there's no problem.
If I go to a post by a user that has uploaded their own picture there's no problem.
If I disable the default picture there's no problem.

So it seems there is this one specific case where things break down: default picture + preset applied.

EDIT: There's more to it than this! I've just been exploring this in an advanced forum issue I raised for a seemingly related problem: #1084520: "User picture preset" image style not respected

Basically, the WSOD was only happening when the path entered for the default user picture was in the format 'sites/default/files/default-picture.png'. After changing it to 'public://default-picture.png' the WSOD ceased.

However, there's another couple of issues after doing that:
1) I get the notice: "Notice: Trying to get property of non-object in include() (line 25 of /var/www/sites/all/modules/author_pane/author-pane-user-picture.tpl.php)."
2) The path linked to by the user picture in the AP block is wrong! Its linking to: http://example.com/http://example.com/.

gordon’s picture

Status: Active » Postponed (maintainer needs more info)

I have tested this profile image and I can't find the issue.

If you look in Administer > Reports > Recent log messages you should see the actual error message that is being thrown by PHP.

Shadlington’s picture

Status: Postponed (maintainer needs more info) » Active

I'm aware of that and as I said in #2 there are no messages in my log after the WSODs. I'm fairly ignorant of PHP settings but could it be that I need to change them? My error_reporting setting is E_ALL | E_STRICT at the moment. Not sure what else is relevant.

The only log message I am able to produce is when I change the path to the default image as described in #3, which is "Notice: Trying to get property of non-object in include() (line 25 of /var/www/sites/all/modules/author_pane/author-pane-user-picture.tpl.php)."

Might I ask where the default image you are using is located and how you have pathed to it in the account settings page? This seems to be highly relevant. Mine is in my sites/default/files/ directory and I get WSOD when it is pathed as such (though it displays correctly elsewhere).

Possibly of use is the fact that there were issues with D7 core image.module a while back that are supposedly fixed but sound related to this: #931898: View user account will down when account settings have some default picture and picture display style is not <none> & #937562: [Regression] Fatal Error Call to a member function getDirectoryPath() on a non-object when Default picture is set

gordon’s picture

I did find 1 issue with this line, and as for the error

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

I have not been able to work our why the account is not from an user_load() and more likely from session. I have a few other ideas and I will chase them down.

Gordon

Shadlington’s picture

Great. Sorry to be a pain with this - I am well aware I haven't given you a great deal of info and that makes it tough to track down these things.
I'm doing my best to get as much detail on the problem as I can but if you can think of anything I could do to help you more then please let me know.

I'm a programmer myself, but not for web (I've started learning PHP but its very early days for me) so I'm really not up to speed on how to debug problems like this. Sorry :(

allhailtheduck’s picture

I was able to work around the WSOD and resulting issues stemming from adding public:// to the default image's path by adding an additional condition to the way template_preprocess_author_pane_user_picture() sets $variables['picture'] (line 262):
Original:

// If we have a picture...
    if (isset($picture)) {
      // If there's a preset set and imagecache is enabled...
      if (!empty($style) && module_exists('image')) {

New:

// If we have a picture...
    if (isset($picture)) {
      // If there's a preset set and imagecache is enabled and the user's picture is not default...
      if (!empty($style) && module_exists('image') && isset($account->picture)) {

adding the check at least stops the errors and gets all images to display. It doesn't result in a default user picture that has been processed by imagecache, however, so I've been manually setting the widths with CSS.

Bohemian58’s picture

Getting the same error message:
Notice: Trying to get property of non-object in include() (line 25 of /.../sites/all/modules/author_pane/author-pane-user-picture.tpl.php).
Read the comments above but I'm not sure how to do this all. The pictures are alle displayed correct by the way, just getting the error message - not always though, don't know what triggers it.

RKS’s picture

Out of curiosity, since the PHP for user-picture has the "if imagecache is enabled," is it looking at the new D7 integration of imagecache? I don't know what all they changed with that integration, but the presets are different and so might there be a problem with saying enabled if there is no imagecache to be enabled? You get what I'm saying? It's late.

Slovak’s picture

Subscribe

Scyther’s picture

For this problem Notice: Trying to get property of non-object in include() there is a patch in this issue #1217780: Notice: Trying to get property of non-object ...

Scyther’s picture

Status: Active » Closed (duplicate)
Issue tags: +7.x-2.x-beta-blocker
Scyther’s picture

Status: Closed (duplicate) » Active
Scyther’s picture

Status: Active » Fixed

This should now be working correctly with new commits to the dev version.

Status: Fixed » Closed (fixed)
Issue tags: -7.x-2.x-beta-blocker

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