diff --git bp-activity/bp-activity-classes.php bp-activity/bp-activity-classes.php
index bf7bfe0..a210786 100644
|
|
class BP_Activity_Activity { |
1013 | 1013 | $parent_id = $r->secondary_item_id; |
1014 | 1014 | while ( $parent_id !== $r->item_id ) { |
1015 | 1015 | $depth++; |
1016 | | $parent_id = $ref[ $parent_id ]->secondary_item_id; |
| 1016 | |
| 1017 | // When display_comments=stream, the |
| 1018 | // parent comment may not be part of |
| 1019 | // the returned results, so we manually |
| 1020 | // fetch it |
| 1021 | if ( empty( $ref[ $parent_id ] ) ) { |
| 1022 | $direct_parent = new BP_Activity_Activity( $parent_id ); |
| 1023 | if ( isset( $direct_parent->secondary_item_id ) ) { |
| 1024 | $parent_id = $direct_parent->secondary_item_id; |
| 1025 | } else { |
| 1026 | // Something went wrong |
| 1027 | // Short-circuit the |
| 1028 | // depth calculation |
| 1029 | $parent_id = $r->item_id; |
| 1030 | } |
| 1031 | } else { |
| 1032 | $parent_id = $ref[ $parent_id ]->secondary_item_id; |
| 1033 | } |
1017 | 1034 | } |
1018 | 1035 | $r->depth = $depth; |
1019 | 1036 | } |