[buddypress-trac] [BuddyPress Trac] #9305: 'joined_group' activity item not removed when user leaves group or is removed from the group
buddypress-trac
noreply at wordpress.org
Wed Jan 7 22:11:50 UTC 2026
#9305: 'joined_group' activity item not removed when user leaves group or is
removed from the group
-------------------------------------------------+-------------------------
Reporter: r-a-y | Owner:
| espellcaste
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 15.0.0
Component: Groups | Version: 1.9
Severity: minor | Resolution:
Keywords: dev-feedback has-patch has-unit- |
tests needs-testing |
-------------------------------------------------+-------------------------
Comment (by emaralive):
Seems to me, in order to understand the pass/fail criteria, one should
base this on the functional requirements. Some of these requirements may
need further clarification, in an effort to reduce ambiguity and
misinterpretations and for sake of an argument, let's pursue the following
as an example.
From [comment:6 johnjamesjacoby] comment 6:
> It seems best to:
>
> * create activity items when a member intentionally joins/leaves, but
not when a mod/admin does it on their behalf
> * clean up the related activity items when a mod/admin does it on their
behalf, but not when a member joins/leaves
If we take the first bulleted item, in context to this ticket an
**activity item** is defined as any of the following:
* `joined_group`
* `rejoined_group`
* `left_group`
[[span(style=color: #FF0000, **NOTE**: Since "**leaves**" is dependent on
`left_group`, for now I'm just framing "**joins**". )]]
The **first clause** of the sentence for **joins**, to me,
indicates/infers:
* Public Group(s) - Only when a member joins or accepts a group
invitation.
* Private Group(s) - Only when a member initiates a group membership
request and it is accepted or accepts a group invitation.
* Hidden Group(s) - Only when a member accepts a group invitation.
The **second clause** may not be needed since, to me, it implies the
**first clause**. However, I'm not sure if I've framed the requirements
accurately nor do others have the same interpretation. Nevertheless, let's
proceed on, since this example is academic.
Scenario:: - User A is a site admin[[br]]- User B is a typical
member[[br]]- Performed against a Public Group
1. User A adds User B to a group via the back-end (Edit Group page) - a
`joined_group` activity item is created.
2. User A adds User B to a group via the REST API - a `joined_group`
activity item is **not** created.
3. User A adds User B to a group via BP CLI - a `joined_group` activity
item is created.
Assuming User B can accomplish the requirements for the first clause,
i.e., **joins** (those tests pass), could we conclude that items 1 and 3
are failures and item 2 is a pass for User A? So, if this framing is
incorrect then, here is your opportunity to provide the correct
framing/interpretation of the requirements for the first bulleted item.
Additionally, a caveat, I may have neglected to include other pertinent
info.
We can move on to the second bulleted item after hashing through what has
been presented here.
BTW, it appears to me that the `left_group` routines require additional
work because with the BP Nouveau template pack, WP 7.0-alpha-61446 and PHP
8.3, I'm getting a fatal error when a member/user leaves a group.
----
== Error Details
{{{
Fatal error: Uncaught ValueError: strpos(): Argument #3 ($offset) must be
contained in argument #1 ($haystack) in buddypress/src/bp-templates/bp-
nouveau/includes/activity/functions.php:371
Stack Trace
1.
strpos()
buddypress/src/bp-templates/bp-nouveau/includes/activity/functions.php:371
2.
bp_nouveau_activity_secondary_avatars()
/wp-includes/class-wp-hook.php:343
3.
WP_Hook->apply_filters()
/wp-includes/plugin.php:256
4.
apply_filters_ref_array()
buddypress/src/bp-activity/bp-activity-template.php:1382
5.
bp_get_activity_action()
buddypress/src/bp-activity/bp-activity-template.php:1348
6.
bp_activity_action()
buddypress/src/bp-templates/bp-nouveau/buddypress/activity/entry.php:30
7.
require('...')
/wp-includes/template.php:816
8.
load_template()
buddypress/src/bp-core/bp-core-template-loader.php:225
9.
bp_locate_template()
buddypress/src/bp-core/bp-core-template-loader.php:67
10.
bp_get_template_part()
buddypress/src/bp-templates/bp-nouveau/buddypress/activity/activity-
loop.php:21
11.
require_once('...')
/wp-includes/template.php:814
12.
load_template()
buddypress/src/bp-templates/bp-nouveau/includes/ajax.php:150
13.
bp_nouveau_ajax_object_template_loader()
/wp-includes/class-wp-hook.php:341
14.
WP_Hook->apply_filters()
/wp-includes/class-wp-hook.php:365
15.
WP_Hook->do_action()
/wp-includes/plugin.php:522
16.
do_action()
/wp-admin/admin-ajax.php:192
17.
{main}
thrown in buddypress/src/bp-templates/bp-
nouveau/includes/activity/functions.php on line 371
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9305#comment:22>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list