Skip to:
Content

bbPress.org

Ticket #3261: 3261_tools.php_for_bbpress_2.5.14.patch

File 3261_tools.php_for_bbpress_2.5.14.patch, 811 bytes (added by GDragoN, 2 years ago)

Fix for the bbPress 2.5.14

  • includes/admin/tools.php

     
    878878
    879879        // Now we give all the forums with topics the ID their last topic.
    880880        if ( is_wp_error( $wpdb->query( "INSERT INTO `$wpdb->postmeta` (`post_id`, `meta_key`, `meta_value`)
    881                         ( SELECT `forum`.`ID`, '_bbp_last_topic_id', `topic`.`ID`
     881                        ( SELECT `forum`.`ID`, '_bbp_last_topic_id', MAX( `topic`.`ID` )
    882882                        FROM `$wpdb->posts` AS `forum` INNER JOIN `$wpdb->posts` AS `topic` ON `forum`.`ID` = `topic`.`post_parent`
    883883                        WHERE `topic`.`post_status` IN ( '" . bbp_get_public_status_id() . "' ) AND `forum`.`post_type` = 'forum' AND `topic`.`post_type` = 'topic'
    884884                        GROUP BY `forum`.`ID` );" ) ) )