Skip to:

Opened 4 years ago

Closed 4 years ago

#8254 closed defect (bug) (fixed)

Undefined `$current_blog` in function `bp_core_delete_existing_avatar`

Reported by: itowhid06's profile itowhid06 Owned by: imath's profile imath
Milestone: 6.0.0 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch commit


Undefined $current_blog in function bp_core_delete_existing_avatar

Attachments (2)

8254.diff (442 bytes) - added by itowhid06 4 years ago.
8254.2.patch (1.1 KB) - added by imath 4 years ago.

Download all attachments as: .zip

Change History (9)

4 years ago

#1 @imath
4 years ago

  • Keywords reporter-feedback added
  • Milestone changed from Awaiting Review to 6.0.0
  • Owner set to imath
  • Status changed from new to assigned

Hi @itowhid06

Thanks for your feedback and patch. Out of curiosity how did you find the issue ?

#2 @itowhid06
4 years ago

Hi @imath

I am working on some BuddyPress integration code. I was looking into how BP is saving avatars and my Code Editor showed me this one. All credit goes to the CE :)

#3 @imath
4 years ago

  • Keywords reporter-feedback removed

Nice, thanks for catching it 👍

4 years ago

#4 follow-up: @imath
4 years ago

I believe it's best to use the function get_current_blog_id(). What do you think ?

#5 in reply to: ↑ 4 @itowhid06
4 years ago

Yes, that is better. Using $current_blog->id should be avoided in all possible cases, and I just created the patch to keep similarity with other usages. +1 to
Replying to imath:

I believe it's best to use the function get_current_blog_id(). What do you think ?

Last edited 4 years ago by itowhid06 (previous) (diff)

#6 @imath
4 years ago

  • Keywords commit added

Thanks for your feedback, let's have this in.

#7 @imath
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 12565:

Stop using the $current_blog global when fetching/deleting an avatar

Props itowhid06

Fixes #8254

Note: See TracTickets for help on using tickets.