Skip to:
Content

bbPress.org

Ticket #3261: 3261_repair.php_for_bbpress_2.6.patch

File 3261_repair.php_for_bbpress_2.6.patch, 816 bytes (added by GDragoN, 2 years ago)

Fix for the bbPress 2.6 trunk

  • includes/admin/tools/repair.php

     
    862862
    863863        // Now we give all the forums with topics the ID their last topic.
    864864        if ( is_wp_error( $bbp_db->query( "INSERT INTO `{$bbp_db->postmeta}` (`post_id`, `meta_key`, `meta_value`)
    865                         ( SELECT `forum`.`ID`, '_bbp_last_topic_id', `topic`.`ID`
     865                        ( SELECT `forum`.`ID`, '_bbp_last_topic_id', MAX( `topic`.`ID` )
    866866                        FROM `{$bbp_db->posts}` AS `forum` INNER JOIN `{$bbp_db->posts}` AS `topic` ON `forum`.`ID` = `topic`.`post_parent`
    867867                        WHERE `topic`.`post_status` = '{$pps}' AND `forum`.`post_type` = '{$fpt}' AND `topic`.`post_type` = '{$tpt}'
    868868                        GROUP BY `forum`.`ID` )" ) ) ) {