Skip to:
Content

BuddyPress.org

#7623 closed defect (bug) (fixed)

Check for logged-in user on bp_activity_add_user_favorite

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

Description

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 20 months ago.
7623-2.diff (1.0 KB) - added by espellcaste 20 months ago.

Download all attachments as: .zip

Change History (6)

#1 @DJPaul
20 months ago

  • Milestone changed from Awaiting Review to 3.0

https://media0.giphy.com/media/bKnEnd65zqxfq/giphy.gif

@espellcaste
20 months ago

#2 @espellcaste
20 months ago

  • Keywords has-patch added; needs-patch removed

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

@espellcaste
20 months ago

#3 @espellcaste
20 months ago

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

#4 @djpaul
19 months 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.