Skip to:
Content

bbPress.org

Changeset 6908


Ignore:
Timestamp:
08/09/2019 08:49:58 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.6 (trunk.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/tools/repair.php

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