From: Tim Starling Date: Tue, 9 Feb 2010 00:57:07 +0000 (+0000) Subject: Bug fix: bt_page and bt_rev_id should be 0 for orphans, not null. X-Git-Tag: 1.31.0-rc.0~37869 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=ac511d039a29fea3513fe3a9669ded6e84e0c0ed;p=lhc%2Fweb%2Fwiklou.git Bug fix: bt_page and bt_rev_id should be 0 for orphans, not null. --- diff --git a/maintenance/storage/fixBug20757.php b/maintenance/storage/fixBug20757.php index cfe0817802..377af700f5 100644 --- a/maintenance/storage/fixBug20757.php +++ b/maintenance/storage/fixBug20757.php @@ -159,14 +159,14 @@ class FixBug20757 extends Maintenance { // Find the page_id and rev_id // The page is probably the same as the page of the secondary row - $pageId = $trackRow->bt_page; - if ( $pageId === null ) { - $revId = null; + $pageId = intval( $trackRow->bt_page ); + if ( !$pageId ) { + $revId = $pageId = 0; } else { $revId = $this->findTextIdInPage( $pageId, $primaryId ); - if ( $revId === null ) { + if ( !$revId ) { // Actually an orphan - $pageId = null; + $pageId = $revId = 0; } } @@ -189,7 +189,7 @@ class FixBug20757 extends Maintenance { // without needing to run trackBlobs.php again $dbw->insert( 'blob_tracking', array( - 'bt_page' => $trackRow->bt_page, + 'bt_page' => $pageId, 'bt_rev_id' => $revId, 'bt_text_id' => $primaryId, 'bt_cluster' => $trackRow->bt_cluster,