From: Dévai Tamás Date: Tue, 15 Jan 2013 17:06:01 +0000 (-0400) Subject: (Bug 40860) make purgeRedundantText not fail on pre MW1.5 records X-Git-Tag: 1.31.0-rc.0~20956 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=e45d154faa576f832f5782411182c58b399f392b;p=lhc%2Fweb%2Fwiklou.git (Bug 40860) make purgeRedundantText not fail on pre MW1.5 records 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 --- 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" );