Error in default profile image

Created on 17 June 2022, over 2 years ago
Updated 12 June 2024, 6 months ago

There is a missing validation into the function social_profile_get_default_image:

Error: Call to a member function id() on null in social_profile_get_default_image() (line 792 of /var/www/html/web/profiles/contrib/open_social/modules/social_features/social_profile/social_profile.module)

As I see, by just validating if file exist should fix issue. Patch in the way.

🐛 Bug report
Status

Closed: duplicate

Version

11.3

Component

Code (back-end)

Created by

🇨🇴Colombia waspper

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany Duwid

    These two tickets are related but not duplicates. In #3271758, the file is validated, and a call to social_profile_get_default_image() is prevented. However, social_profile_get_default_image() is called in multiple places, e.g., by EmailTokenServices::getUserPreview(). As wassper correctly assumed, a check is needed to see if the file exists in social_profile_get_default_image().

    Here is a new approach for open_social 12.

Production build 0.71.5 2024