Error: Call to a member function id() on null in social_core_preprocess_block() (line 203 of profiles/contrib/social/modules/social_features/social_core/social_core.module).

I am getting this error when open some user profiles using non admin account (student_01). I guess it is a permission issue because this work well for admin.

Comments

Chi created an issue. See original summary.

DeBeukeleerM’s picture

I have a similar error:
Fatal error: Call to a member function getEntity() on null in C:\wamp\www\democratie\profiles\contrib\social\profiles\social\themes\socialbase\includes\block.inc on line 169
It occurs while I will login on my local site

jochemvn’s picture

Priority: Normal » Critical
frankgraave’s picture

Hi Chi,

If I understand this correctly you meant that when u logged in as any demo user, you are not able to go to /user/11/stream? (this is the account id of student_01). I have tested this scenario on the version you reported in this bug report and on the current version of Open Social (RC3). I was not able to reproduce this bug.

If I misunderstood your bug report then please clarify how to reproduce this so I can test this, thanks!

frankgraave’s picture

Status: Active » Postponed (maintainer needs more info)
frankgraave’s picture

Status: Postponed (maintainer needs more info) » Active

Hi Chi,

I did find something. There are certain demo users with a 'blocked' status by default. However, these users show up in the /all-members page where one might click on the blocked user. Since the logged in user (not admin) does not have permission to view this account, the error you provide will be thrown. I will look into this, thanks!

jochemvn’s picture

Hi,

This issue has been fixed in: https://patch-diff.githubusercontent.com/raw/goalgorilla/open_social/pul.... It will be included in the RC4.

Jochem

jochemvn’s picture

Status: Active » Needs review
frankgraave’s picture

Status: Needs review » Reviewed & tested by the community

Works like a charm, this will be part of RC4!

Frank

  • jochemvn committed 5960d17 on 8.x-1.x
    #2866041 by jochemvn: Add relationship to user table and filter out...
  • jochemvn committed 60ee7fd on 8.x-1.x
    #2866041 by jochemvn: Check if the user object is in fact a user object...
  • frankgraave authored c2dcbb8 on 8.x-1.x
    Merge pull request #362 from goalgorilla/feature/2866041
    
    #2866041 - Fix...
jaapjan’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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