Changeset 7807
- Timestamp:
- 10/04/2026 12:28:35 PM (5 weeks ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
CHANGELOG.md (modified) (1 diff)
-
src/includes/replies/functions.php (modified) (2 diffs)
-
tests/phpunit/testcases/replies/functions/reply.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG.md
r7772 r7807 45 45 ### Fixed 46 46 47 - Prevented threaded reply ancestry from including an invalid parent and avoided redundant reply-position writes. 47 48 - Restored assigned moderator names in forum edit forms and corrected forum type and visibility dropdown behavior. 48 49 - Kept closed category ancestors from being ignored by forum status checks. -
trunk/src/includes/replies/functions.php
r7765 r7807 1195 1195 1196 1196 // Loop detection: If the ancestor has been seen before, break. 1197 if ( empty( $ ancestor->post_parent ) || ( $grampy_id === $reply_id ) || in_array( $grampy_id, $ancestors, true ) ) {1197 if ( empty( $grampy_id ) || empty( $ancestor->post_parent ) || ( $grampy_id === $reply_id ) || in_array( $grampy_id, $ancestors, true ) ) { 1198 1198 break; 1199 1199 } … … 2439 2439 2440 2440 // Get the current reply position 2441 $current_position = get_post_field( 'menu_order', $reply_id );2441 $current_position = (int) get_post_field( 'menu_order', $reply_id ); 2442 2442 2443 2443 // Bail if no change -
trunk/tests/phpunit/testcases/replies/functions/reply.php
r7804 r7807 257 257 /** 258 258 * @covers ::bbp_get_reply_ancestors 259 * @todo Implement test_bbp_get_reply_ancestors().260 259 */ 261 260 public function test_bbp_get_reply_ancestors() { 262 // Remove the following lines when you implement this test. 263 $this->markTestIncomplete( 264 'This test has not been implemented yet.' 265 ); 261 $topic_id = $this->factory->topic->create(); 262 $root_id = $this->factory->reply->create( array( 'post_parent' => $topic_id ) ); 263 $parent_id = $this->factory->reply->create( array( 'post_parent' => $topic_id ) ); 264 $child_id = $this->factory->reply->create( array( 'post_parent' => $topic_id ) ); 265 bbp_update_reply_to( $parent_id, $root_id ); 266 bbp_update_reply_to( $child_id, $parent_id ); 267 268 $this->assertSame( array(), bbp_get_reply_ancestors( $root_id ) ); 269 $this->assertSame( array( $root_id ), bbp_get_reply_ancestors( $parent_id ) ); 270 $this->assertSame( array( $parent_id, $root_id ), bbp_get_reply_ancestors( $child_id ) ); 266 271 } 267 272 … … 557 562 /** 558 563 * @covers ::bbp_update_reply_position 559 * @todo Implement test_bbp_update_reply_position().560 564 */ 561 565 public function test_bbp_update_reply_position() { 562 // Remove the following lines when you implement this test. 563 $this->markTestIncomplete( 564 'This test has not been implemented yet.' 565 ); 566 $topic_id = $this->factory->topic->create(); 567 $reply_id = $this->factory->reply->create( array( 'post_parent' => $topic_id ) ); 568 569 $this->assertSame( 3, bbp_update_reply_position( $reply_id, 3 ) ); 570 $this->assertSame( 3, (int) get_post_field( 'menu_order', $reply_id ) ); 571 $this->assertFalse( bbp_update_reply_position( $reply_id, 3 ) ); 566 572 } 567 573
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)