Skip to:
Content

bbPress.org

Changeset 6909


Ignore:
Timestamp:
08/09/2019 08:52:13 PM (13 days ago)
Author:
johnjamesjacoby
Message:

Tools/Repair: add missing MAX() in bbp_admin_repair_freshness().

This commit allows the freshness repair tool to correctly query for the maximum topic ID.

Fixes #3261.
Props GDragoN.
For 2.5.x.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/includes/admin/tools.php

    r6906 r6909  
    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'
Note: See TracChangeset for help on using the changeset viewer.