Changeset 7135
- Timestamp:
- 08/14/2020 05:49:20 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/src/includes/admin/tools/repair.php
r6934 r7135 426 426 427 427 if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) { 428 428 return array( 1, sprintf( $statement, $result ) ); 429 429 } 430 430 … … 468 468 469 469 if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) { 470 470 return array( 1, sprintf( $statement, $result ) ); 471 471 } 472 472 … … 992 992 } 993 993 994 995 994 // Loop through forums 995 foreach ( $forums as $forum_id ) { 996 996 if ( ! bbp_is_forum_category( $forum_id ) ) { 997 997 bbp_update_forum( array( 'forum_id' => $forum_id ) ); … … 1107 1107 1108 1108 // If we don't have a postmeta _bbp_status value 1109 if ( empty( $topic_status ) ) {1109 if ( empty( $topic_status ) ) { 1110 1110 update_post_meta( $closed_topic, '_bbp_status', 'publish' ); 1111 1111 ++$changed; // Keep a count to display at the end … … 1164 1164 $tpt = bbp_get_topic_post_type(); 1165 1165 $rpt = bbp_get_reply_post_type(); 1166 $fmt = bbp_get_forum_post_type(); 1166 1167 1167 1168 // Next, give all the topics their parent forum id. … … 1172 1173 WHERE `topic`.`post_type` = '{$tpt}' 1173 1174 GROUP BY `topic`.`ID` )" ) ) ) { 1175 return array( 2, sprintf( $statement, $result ) ); 1176 } 1177 1178 // Next, give all the forums their parent forum id. 1179 if ( is_wp_error( $bbp_db->query( "INSERT INTO `{$bbp_db->postmeta}` (`post_id`, `meta_key`, `meta_value`) 1180 ( SELECT `forum`.`ID`, '_bbp_forum_id', `forum`.`post_parent` 1181 FROM `$bbp_db->posts` 1182 AS `forum` 1183 WHERE `forum`.`post_type` = '{$fmt}' 1184 GROUP BY `forum`.`ID` )" ) ) ) { 1174 1185 return array( 2, sprintf( $statement, $result ) ); 1175 1186 }
Note: See TracChangeset
for help on using the changeset viewer.