dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanupUsersWithNoId.php: Handle missing fields
[lhc/web/wiklou.git]
/
maintenance
/
cleanupUsersWithNoId.php
diff --git
a/maintenance/cleanupUsersWithNoId.php
b/maintenance/cleanupUsersWithNoId.php
index
f7fd9d5
..
5232f91
100644
(file)
--- a/
maintenance/cleanupUsersWithNoId.php
+++ b/
maintenance/cleanupUsersWithNoId.php
@@
-131,13
+131,18
@@
class CleanupUsersWithNoId extends LoggedUpdateMaintenance {
return;
}
return;
}
+ $dbw = $this->getDB( DB_MASTER );
+ if ( !$dbw->fieldExists( $table, $idField ) ||
+ !$dbw->fieldExists( $table, $nameField )
+ ) {
+ $this->output( "Skipping $table, fields $idField and/or $nameField do not exist\n" );
+ return;
+ }
+
$primaryKey = (array)$primaryKey;
$pkFilter = array_flip( $primaryKey );
$primaryKey = (array)$primaryKey;
$pkFilter = array_flip( $primaryKey );
- $this->output(
- "Beginning cleanup of $table\n"
- );
+ $this->output( "Beginning cleanup of $table\n" );
- $dbw = $this->getDB( DB_MASTER );
$next = '1=1';
$countAssigned = 0;
$countPrefixed = 0;
$next = '1=1';
$countAssigned = 0;
$countPrefixed = 0;