From e45d154faa576f832f5782411182c58b399f392b Mon Sep 17 00:00:00 2001 From: =?utf8?q?D=C3=A9vai=20Tam=C3=A1s?= Date: Tue, 15 Jan 2013 13:06:01 -0400 Subject: [PATCH] (Bug 40860) make purgeRedundantText not fail on pre MW1.5 records MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Archive records for deleted pages do not have an ar_text_id, if they were deleted before big schema overhaul in MW 1.5. This script was assuming all archive records had an ar_text_id. Patch by Dévai Tamás. Change-Id: I4776a8a0f29b8299ec6d27949dc53a96ece81f39 --- CREDITS | 1 + maintenance/Maintenance.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index ca5d6d7f6e..a03ad5ebf7 100644 --- a/CREDITS +++ b/CREDITS @@ -120,6 +120,7 @@ following names for their contribution to the product. * Daniel Werner * David Baumgarten * Denny Vrandecic +* Dévai Tamás * Edward Z. Yang * Elvis Stansvik * Erwin Dokter diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index b0371c0324..45df0e9df2 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -952,7 +952,10 @@ abstract class Maintenance { $this->output( 'Searching for active text records in archive table...' ); $res = $dbw->query( "SELECT DISTINCT ar_text_id FROM $tbl_arc" ); foreach ( $res as $row ) { - $cur[] = $row->ar_text_id; + # old pre-MW 1.5 records can have null ar_text_id's. + if ( $row->ar_text_id !== null ) { + $cur[] = $row->ar_text_id; + } } $this->output( "done.\n" ); -- 2.20.1