Skip to:
Content

BuddyPress.org

Opened 9 months ago

Closed 9 months ago

#8254 closed defect (bug) (fixed)

Undefined `$current_blog` in function `bp_core_delete_existing_avatar`

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

Description

Undefined $current_blog in function bp_core_delete_existing_avatar

Attachments (2)

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

Download all attachments as: .zip

Change History (9)

@itowhid06
9 months ago

#1 @imath
9 months 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
9 months 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
9 months ago

  • Keywords reporter-feedback removed

Nice, thanks for catching it 👍

@imath
9 months ago

#4 follow-up: @imath
9 months ago

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

#5 in reply to: ↑ 4 @itowhid06
9 months 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 https://buddypress.trac.wordpress.org/attachment/ticket/8254/8254.2.patch.
Replying to imath:

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

Last edited 9 months ago by itowhid06 (previous) (diff)

#6 @imath
9 months ago

  • Keywords commit added

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

#7 @imath
9 months 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.