Skip to:
Content

bbPress.org

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#3405 closed defect (bug) (fixed)

topic/forum notification emails not sent to some subscribers

Reported by: muratgu's profile muratgu Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6.6 Priority: high
Severity: major Version: 2.6.0
Component: API - Subscriptions Keywords: needs-testing
Cc:

Description

The function bbp_get_email_addresses_from_user_ids builds an incomplete list of emails.

1379                    // Get total number of sets
1380                    $steps = ceil( count( $user_ids ) / $limit );
1381                    $range = array_map( 'intval', range( 1, $steps ) );
1382    
1383                    // Loop through users
1384                    foreach ( $range as $loop ) {
1385    
1386                            // Initial loop has no offset
1387                            $offset = ( 1 === $loop )
1388                                    ? 0
1389                                    : $limit * $loop;
1390    
1391                            // Calculate user IDs to include
1392                            $loop_ids = array_slice( $user_ids, $offset, $limit );

The $offset calculation on line 1387 is not correct. The offset value jumps from 0 to 200, if the limit is 100, and skips everyone in between. It should have been like this:

1387                            $offset = $limit * ($loop - 1);

Change History (4)

#1 @johnjamesjacoby
4 years ago

  • Component changed from Component - Forums to API - Subscriptions
  • Milestone changed from Awaiting Review to 2.6.6
  • Owner set to johnjamesjacoby
  • Status changed from new to assigned
  • Version changed from trunk to 2.6.0

#2 @johnjamesjacoby
4 years ago

  • Keywords needs-testing added

#3 @johnjamesjacoby
4 years ago

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

In 7151:

Emails: correct logic in bbp_get_email_addresses_from_user_ids().

This commit makes sure that the query offset (for looping through user IDs) does not unintentionally skip over any IDs in the allowed ranges.

In branches/2.6, for 2.6.6. Fixes #3405.

Props muratgu.

#4 @johnjamesjacoby
4 years ago

In 7152:

Emails: correct logic in bbp_get_email_addresses_from_user_ids().

This commit makes sure that the query offset (for looping through user IDs) does not unintentionally skip over any IDs in the allowed ranges.

In trunk, for 2.7. Fixes #3405.

Props muratgu.

Note: See TracTickets for help on using tickets.