Skip to:
Content

BuddyPress.org

Opened 2 months ago

Closed 3 weeks 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 Owned by: espellcaste
Milestone: 10.0.0 Priority: normal
Severity: normal Version: 8.0.0
Component: REST API Keywords:
Cc:

Description

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.

File: https://github.com/buddypress/BP-REST/blob/master/includes/bp-activity/classes/class-bp-rest-activity-endpoint.php

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
2 months 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
2 months ago

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

#3 @imath
2 months ago

Thanks a lot 😍

#4 @imath
4 weeks 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
4 weeks ago

Last edited 4 weeks ago by espellcaste (previous) (diff)

#6 @imath
4 weeks ago

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

#7 @espellcaste
3 weeks 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.