Skip to:
Content

bbPress.org

Ticket #2529: 2529.4.diff

File 2529.4.diff, 839 bytes (added by thebrandonallen, 10 years ago)

Patch bbp_update_reply_walker

  • src/includes/replies/functions.php

    diff --git src/includes/replies/functions.php src/includes/replies/functions.php
    index ad32198..543f47a 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 ) ) {
     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 ) ) {
     954                                $forum_id = bbp_get_topic_forum_id( $topic_id ) );
     955                        }
    946956                }
    947957        }
    948958