X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FeraseArchivedFile.php;h=d94d49b72b46dd5699033907887ea314d048e23d;hb=1ec7e520d388b7cf23e116ac8f7a5a89ab613f9e;hp=05fbbbcb492f34202071e7db176f5217690c1386;hpb=732b5e2745ca8f6153e19cc10c3c9acb1b2a6331;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/eraseArchivedFile.php b/maintenance/eraseArchivedFile.php index 05fbbbcb49..d94d49b72b 100644 --- a/maintenance/eraseArchivedFile.php +++ b/maintenance/eraseArchivedFile.php @@ -55,9 +55,10 @@ class EraseArchivedFile extends Maintenance { $afile = false; } else { // specified version $dbw = $this->getDB( DB_MASTER ); - $row = $dbw->selectRow( 'filearchive', ArchivedFile::selectFields(), + $fileQuery = ArchivedFile::getQueryInfo(); + $row = $dbw->selectRow( $fileQuery['tables'], $fileQuery['fields'], [ 'fa_storage_group' => 'deleted', 'fa_storage_key' => $filekey ], - __METHOD__ ); + __METHOD__, [], $fileQuery['joins'] ); if ( !$row ) { $this->error( "No deleted file exists with key '$filekey'.", 1 ); } @@ -85,9 +86,10 @@ class EraseArchivedFile extends Maintenance { protected function scrubAllVersions( $name ) { $dbw = $this->getDB( DB_MASTER ); - $res = $dbw->select( 'filearchive', ArchivedFile::selectFields(), + $fileQuery = ArchivedFile::getQueryInfo(); + $res = $dbw->select( $fileQuery['tables'], $fileQuery['fields'], [ 'fa_name' => $name, 'fa_storage_group' => 'deleted' ], - __METHOD__ ); + __METHOD__, [], $fileQuery['joins'] ); foreach ( $res as $row ) { $this->scrubVersion( ArchivedFile::newFromRow( $row ) ); }