Skip to:
Content

bbPress.org

Ticket #2529: 2529.5.diff

File 2529.5.diff, 926 bytes (added by thebrandonallen, 7 years ago)

Same as 2529.4.diff, targeted on run on bbp_deleted_reply only

  • src/includes/replies/functions.php

    diff --git src/includes/replies/functions.php src/includes/replies/functions.php
    index ad32198..77d50d7 100644
    function bbp_update_reply_walker( $reply_id, $last_active_time = '', $forum_id = 
    938938                // Get the topic ID if none was passed
    939939                if ( empty( $topic_id ) ) {
    940940                        $topic_id = bbp_get_reply_topic_id( $reply_id );
     941
     942                        // Make every effort to get topic id
     943                        if ( empty( $topic_id ) && 'bbp_deleted_reply' === current_action() ) {
     944                                $topic_id = get_post_field( 'post_parent', $reply_id );
     945                        }
    941946                }
    942947
    943948                // Get the forum ID if none was passed
    944949                if ( empty( $forum_id ) ) {
    945950                        $forum_id = bbp_get_reply_forum_id( $reply_id );
     951
     952                        // Make every effort to get forum id
     953                        if ( empty( $forum_id ) && 'bbp_deleted_reply' === current_action() ) {
     954                                $forum_id = bbp_get_topic_forum_id( $topic_id ) );
     955                        }
    946956                }
    947957        }