Skip to:

Opened 7 years ago

Closed 6 years ago

Last modified 3 years ago

#7623 closed defect (bug) (fixed)

Check for logged-in user on bp_activity_add_user_favorite

Reported by: espellcaste's profile espellcaste Owned by: djpaul's profile djpaul
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9.0
Component: Activity Keywords: has-patch


On wp-cli-buddypress, regardless if you add a user_id, bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) always returns false because it checks for is_user_logged_in().

I'd like to suggest a change in the logic so that when I a user_id is provided, this logged_in checked is not called.

Attachments (2)

7623.diff (632 bytes) - added by espellcaste 7 years ago.
7623-2.diff (1.0 KB) - added by espellcaste 7 years ago.

Download all attachments as: .zip

Change History (6)

#1 @DJPaul
7 years ago

  • Milestone changed from Awaiting Review to 3.0

7 years ago

#2 @espellcaste
7 years ago

  • Keywords has-patch added; needs-patch removed

Patch inside! There is no need for the logged_in function.

7 years ago

#3 @espellcaste
7 years ago

Upon further look, bp_activity_add_user_favorite and bp_activity_remove_user_favorite needed the logged_in check removed. Patch .

#4 @djpaul
6 years ago

  • Owner set to djpaul
  • Resolution set to fixed
  • Status changed from new to closed

In 11751:

Activity: fix favouriting functions for CLI use.

Don't require authenticated user in favouriting functions, especially as the function accepts an optional $user_id parameter.

Fixes #7623

Props espellcaste

Note: See TracTickets for help on using tickets.