Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -1240,15 +1240,16 @@ |
1241 | 1241 | array( 'fpc_page_id', 'fpc_select' ), |
1242 | 1242 | array( 'fpc_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ), |
1243 | 1243 | __METHOD__ |
| 1244 | + // array( 'LOCK IN SHARE MODE' ) |
1244 | 1245 | ); |
1245 | | - $pageIds = array(); |
| 1246 | + $pageIds = $pagesClearTracking = array(); |
1246 | 1247 | $config = self::getDefaultVisibilitySettings(); // config is to be reset |
1247 | 1248 | while( $row = $dbw->fetchObject( $ret ) ) { |
1248 | 1249 | // If FlaggedRevs got "turned off" for this page (due to not |
1249 | 1250 | // having the stable version as the default), then clear it |
1250 | 1251 | // from the tracking tables... |
1251 | 1252 | if( !$config['override'] && FlaggedRevs::forDefaultVersionOnly() ) { |
1252 | | - self::clearTrackingRows( $row->fpc_page_id ); |
| 1253 | + $pagesClearTracking[] = $row->fpc_page_id; // no stable version |
1253 | 1254 | // Check if the new (default) config has a different way |
1254 | 1255 | // of selecting the stable version of this page... |
1255 | 1256 | } else if( $config['select'] !== intval($row->fpc_select) ) { |
— | — | @@ -1259,7 +1260,7 @@ |
1260 | 1261 | $article = new Article( $title ); |
1261 | 1262 | self::updateStableVersion( $article, $srev, $title->getArticleID() ); |
1262 | 1263 | } else { |
1263 | | - self::clearTrackingRows( $row->fpc_page_id ); // no stable version |
| 1264 | + $pagesClearTracking[] = $row->fpc_page_id; // no stable version |
1264 | 1265 | } |
1265 | 1266 | } |
1266 | 1267 | $pageIds[] = $row->fpc_page_id; |
— | — | @@ -1268,6 +1269,10 @@ |
1269 | 1270 | if( count($pageIds) ) { |
1270 | 1271 | $dbw->delete( 'flaggedpage_config', array( 'fpc_page_id' => $pageIds ), __METHOD__ ); |
1271 | 1272 | } |
| 1273 | + // Clear the tracking rows where needed |
| 1274 | + if( count($pagesClearTracking) ) { |
| 1275 | + self::clearTrackingRows( $pagesClearTracking ); |
| 1276 | + } |
1272 | 1277 | } |
1273 | 1278 | |
1274 | 1279 | ################# Other utility functions ################# |
— | — | @@ -1397,7 +1402,7 @@ |
1398 | 1403 | |
1399 | 1404 | /** |
1400 | 1405 | * Clear FlaggedRevs tracking tables for this page |
1401 | | - * @param int $pageId |
| 1406 | + * @param mixed $pageId (int or array) |
1402 | 1407 | */ |
1403 | 1408 | public static function clearTrackingRows( $pageId ) { |
1404 | 1409 | $dbw = wfGetDB( DB_MASTER ); |