Ticket #3310: repair.php.patch
File repair.php.patch, 1.2 KB (added by , 3 years ago) |
---|
-
repair.php
1163 1163 // Post types and status 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. 1168 1169 if ( is_wp_error( $bbp_db->query( "INSERT INTO `{$bbp_db->postmeta}` (`post_id`, `meta_key`, `meta_value`) … … 1174 1175 return array( 2, sprintf( $statement, $result ) ); 1175 1176 } 1176 1177 1178 // Next, give all the topics 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 `topic`.`ID`, '_bbp_forum_id', `topic`.`post_parent` 1181 FROM `$bbp_db->posts` 1182 AS `topic` 1183 WHERE `topic`.`post_type` = '{$fmt}' 1184 GROUP BY `topic`.`ID` )" ) ) ) { 1185 return array( 2, sprintf( $statement, $result ) ); 1186 } 1187 1177 1188 // Next, give all the replies their parent forum id. 1178 1189 if ( is_wp_error( $bbp_db->query( "INSERT INTO `{$bbp_db->postmeta}` (`post_id`, `meta_key`, `meta_value`) 1179 1190 ( SELECT `reply`.`ID`, '_bbp_forum_id', `topic`.`post_parent`