[buddypress-trac] [BuddyPress Trac] #9270: Returns false when it should return an empty array.

buddypress-trac noreply at wordpress.org
Fri Feb 14 12:41:56 UTC 2025


#9270: Returns false when it should return an empty array.
----------------------------+------------------------------
 Reporter:  alexanderwbell  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Activity        |     Version:  14.3.2
 Severity:  minor           |  Resolution:
 Keywords:  has-patch       |
----------------------------+------------------------------
Changes (by prbot):

 * keywords:  needs-patch => has-patch


Comment:

 ''This ticket was mentioned in
 [https://github.com/buddypress/buddypress/pull/405 PR #405] on
 [https://github.com/buddypress/buddypress/ buddypress/buddypress] by
 [https://github.com/Alexanderwbell Alexanderwbell].''
 https://buddypress.trac.wordpress.org/ticket/9270#ticket




 When the activity item was cached and has no comments, we still need to
 return an empty array, just like how the rest of the function returns an
 empty array when there are no comments. Other functions depend on this
 being the case. For example, line 2618 in bp-activity-template.php in the
 function bp_activity_get_comment_depth will throw an error if this is not
 the case. We could also set bp_activity_get_comment_depth to check if
 $comments returned is false in that function and set it to an empty array.

 But in this version, we return $comments (which is an empty array) instead
 of false on line 1649 (I believe) of class-bp-activity-activity.php in the
 public static function get_activity_comments.

 Trac ticket:

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9270#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list