Changeset 9052
- Timestamp:
- 09/27/2014 09:39:23 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-functions.php
r8996 r9052 1351 1351 $activity_id = $r['activity_id']; 1352 1352 1353 // Get the parent activity 1354 $activity = new BP_Activity_Activity( $activity_id ); 1355 1356 // Bail if the parent activity does not exist 1357 if ( empty( $activity->date_recorded ) ) { 1358 return false; 1359 } 1360 1353 1361 // Check to see if the parent activity is hidden, and if so, hide this comment publically. 1354 $activity = new BP_Activity_Activity( $activity_id );1355 1362 $is_hidden = ( (int) $activity->hide_sitewide ) ? 1 : 0; 1356 1363 … … 1662 1669 } 1663 1670 } 1664 1671 1665 1672 // Delete the comment itself 1666 1673 bp_activity_delete( array( -
trunk/tests/phpunit/testcases/activity/functions.php
r8990 r9052 724 724 725 725 /** 726 * @group bp_activity_new_comment 727 * @group BP5907 728 */ 729 public function test_bp_activity_comment_on_deleted_activity() { 730 $a = $this->factory->activity->create(); 731 732 bp_activity_delete_by_activity_id( $a ); 733 734 $c = bp_activity_new_comment( array( 735 'activity_id' => $a, 736 'parent_id' => $a, 737 'content' => 'foo', 738 'user_id' => 1, 739 ) ); 740 741 $this->assertEmpty( $c ); 742 } 743 744 /** 726 745 * @group favorites 727 746 * @group bp_activity_add_user_favorite
Note: See TracChangeset
for help on using the changeset viewer.