(solved) Bool warning when posting an activity to the profile wall

For documentation of changes to the PGSocial Network extension
Post Reply
User avatar
Mandi
Site Admin
Site Admin
Posts: 47
Joined: July 31st, 2023, 8:37 pm
Location: Somewhere, Canada
Contact:

(solved) Bool warning when posting an activity to the profile wall

Post by Mandi »

This warning showed up when posting an activity to the profile wall

Code: Select all


    Activity 

    [phpBB Debug] PHP Warning: in file [ROOT]/ext/pgreca/pgsocial/social/post_status.php on line 516: Trying to access array offset on value of type bool
User avatar
Mandi
Site Admin
Site Admin
Posts: 47
Joined: July 31st, 2023, 8:37 pm
Location: Somewhere, Canada
Contact:

Re: Bool warning when posting an activity to the profile wall

Post by Mandi »

Locate line 516 which looks like this

Code: Select all

($status_privacy == 1 && ($this->social_zebra->friend_status($row['wall_id'])['status'] == 'PG_SOCIAL_FRIENDS' || $this->user->data['user_id'] == $row['wall_id'])) ||
Replace with this:

Code: Select all

($status_privacy == 1 && ($this->social_zebra->friend_status($row['wall_id'])['status'] ?? null == 'PG_SOCIAL_FRIENDS' || $this->user->data['user_id'] == $row['wall_id'])) ||
Post Reply