Skip to:

Opened 3 years ago

Closed 3 years ago

#8524 closed defect (bug) (fixed)

"item_id" is not saved when updating an activity that belongs to a group using the REST endpoint

Reported by: oddev56's profile oddev56 Owned by: espellcaste's profile espellcaste
Milestone: 10.0.0 Priority: normal
Severity: normal Version: 8.0.0
Component: REST API Keywords:


BuddyPress version 8.0.0.

When using the REST endpoint for updating an activity with component set to "groups" the "item_id" (sent in the "primary_item_id" argument) is not being correctly set in the $prepared_activity object, and is set to 0 when the activity is created via the call to "bp_activity_add" in the "update_item" function.

The cause of this issue resides in the "prepare_item_for_database" function, where the "$prepared_activity->item_id" is only set when the activity component doesn't belong to a group.

When it belongs to a group, the "$prepared_activity->group_id" is set to the "item_id", and this value isn't used for setting the "item_id" in the "bp_activity_add" function.


Line 1039-1050.

This issue impedes the use of the REST endpoint for updating group component activities, therefore blocking our ability to add edit functionality until it is resolved.

Change History (7)

#1 @imath
3 years ago

  • Owner set to espellcaste
  • Severity changed from blocker to normal
  • Status changed from new to assigned

Hi thanks for your feedback. I thought we fixed this issue. @espellcaste could you have a look at it?

#2 @espellcaste
3 years ago

I don't remember this issue. Going to take a look. :)

#3 @imath
3 years ago

Thanks a lot 😍

#4 @imath
3 years ago

  • Milestone changed from Awaiting Review to 10.0.0

Let's make sure to fix this during 10.0.0 dev cycle.

#5 @espellcaste
3 years ago

Last edited 3 years ago by espellcaste (previous) (diff)

#6 @imath
3 years ago

Awesome, thanks a lot @espellcaste I'll review it asap.

#7 @espellcaste
3 years ago

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

Pull request was merged and will be available at BuddyPress version 10.0.0.

Note: See TracTickets for help on using tickets.