[buddypress-trac] [BuddyPress Trac] #8524: "item_id" is not saved when updating an activity that belongs to a group using the REST endpoint
buddypress-trac
noreply at wordpress.org
Wed Jul 14 19:15:22 UTC 2021
#8524: "item_id" is not saved when updating an activity that belongs to a group
using the REST endpoint
--------------------------+-----------------------------
Reporter: oddev56 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 8.0.0
Severity: blocker | 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.
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.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8524>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list