Skip to:
Content

bbPress.org

Ticket #3169: patch_prevent_infinite_loop_on_reply_update.diff

File patch_prevent_infinite_loop_on_reply_update.diff, 597 bytes (added by moejonet, 2 years ago)

my patch to solve this issue

  • functions.php

     
    22212221                remove_post_type_support( bbp_get_reply_post_type(), 'revisions' );
    22222222        }
    22232223
     2224        // dont update if menu_order didnt change
     2225
     2226        $db_menu_order = $wpdb->get_var("select menu_order from {$wpdb->posts} where ID={$reply_id}");
     2227       
     2228        if($db_menu_order == $reply_position)
     2229            return (int) $reply_position;
     2230
    22242231        // Update the replies' 'menu_order' with the reply position
    22252232        wp_update_post( array(
    22262233                'ID'         => $reply_id,