* (T112474) Generalized the ResourceLoader mechanism for overriding modules
using a particular page during edit previews.
* Added 'ApiParseMakeOutputPage' hook.
-* (T174313) Added checkbox on Special:ListUsers to display only users in temporary
- user groups.
+* (T174313) Added checkbox on Special:ListUsers to display only users in
+ temporary user groups.
=== External library changes in 1.32 ===
* …
* mw.util.updateTooltipAccessKeys(), deprecated in 1.24, was removed. Use
jquery.accessKeyLabel instead.
* The SqlDataUpdate class, deprecated in 1.28, has been removed.
-* The Html5Internal and Html5Depurate tidy driver classes were removed, along with the
- Balancer tidy implementation. Both implementations were experimental, and were replaced
- by RemexHtml.
+* The Html5Internal and Html5Depurate tidy driver classes were removed, along
+ with the Balancer tidy implementation. Both implementations were experimental,
+ and were replaced by RemexHtml.
* (T179624) Job::insert() and ::batchInsert(), deprecated in 1.21, were both
removed. Use JobQueueGroup::singleton()->push() instead.
* The jquery.footHovzer module, for mediawiki.debug, was removed.
* The es5-shim module, empty and deprecated since 1.29, was removed.
-* The mediawiki.widgets.visibleByteLimit module, deprecated in 1.32, was removed.
- Use mediawiki.widgets.visibleLengthLimit instead.
+* The mediawiki.widgets.visibleByteLimit module alias, deprecated in 1.32, was
+ removed. Use mediawiki.widgets.visibleLengthLimit instead.
* The jquery.farbtastic module, unused since 1.18, was removed.
=== Deprecations in 1.32 ===
$this->addOption( 'dry-run', 'Print debug info instead of actually deleting' );
$this->addOption(
'check-old',
- 'Check old patrol logs (for deleting old format autopatrols).' .
- 'Note that this will not delete rows older than 2011 (MediaWiki 1.18).'
+ 'Check old patrol logs (for deleting old format autopatrols).'
);
$this->addOption(
'before',
$autopatrols = [];
foreach ( $result as $row ) {
$last = $row->log_id;
- Wikimedia\suppressWarnings();
- $params = unserialize( $row->log_params );
- Wikimedia\restoreWarnings();
+ $logEntry = DatabaseLogEntry::newFromRow( $row );
+ $params = $logEntry->getParameters();
+ if ( !is_array( $params ) ) {
+ continue;
+ }
- // Skipping really old rows, before 2011
- if ( !is_array( $params ) || !array_key_exists( '6::auto', $params ) ) {
+ // This logic belongs to PatrolLogFormatter::getMessageKey
+ // and LogFormatter::extractParameters the 'auto' value is logically presented as key [5].
+ // For legacy case the logical key is index + 3, meaning [2].
+ // For the modern case, the logical key is index - 1 meaning [6].
+ if ( array_key_exists( '6::auto', $params ) ) {
+ // Between 2011-2016 autopatrol logs
+ $auto = $params['6::auto'] === true;
+ } elseif ( $logEntry->isLegacy() === true && array_key_exists( 2, $params ) ) {
+ // Pre-2011 autopatrol logs
+ $auto = $params[2] === '1';
+ } else {
continue;
}
- $auto = $params['6::auto'];
- if ( $auto ) {
+ if ( $auto === true ) {
$autopatrols[] = $row->log_id;
}
}
'log_timestamp' => 20091223210426
];
+ // Autopatrol #4 very old way
+ $logs[] = [
+ 'log_type' => 'patrol',
+ 'log_action' => 'patrol',
+ 'log_user' => 7257,
+ 'log_params' => "9227851\n0\n1",
+ 'log_timestamp' => 20081223210426
+ ];
+
+ // Manual patrol #3 very old way
+ $logs[] = [
+ 'log_type' => 'patrol',
+ 'log_action' => 'patrol',
+ 'log_user' => 7258,
+ 'log_params' => "9227851\n0\n0",
+ 'log_timestamp' => 20091223210426
+ ];
+
wfGetDB( DB_MASTER )->insert( 'logging', $logs );
}
'log_action' => 'patrol',
'log_user' => '7256',
],
+ (object)[
+ 'log_type' => 'patrol',
+ 'log_action' => 'patrol',
+ 'log_user' => '7257',
+ ],
+ (object)[
+ 'log_type' => 'patrol',
+ 'log_action' => 'patrol',
+ 'log_user' => '7258',
+ ],
];
$cases = [
$allRows[3],
$allRows[5],
$allRows[6],
+ $allRows[7],
+ $allRows[8],
],
[ '--sleep', '0', '-q' ]
],
$allRows[4],
$allRows[5],
$allRows[6],
+ $allRows[7],
+ $allRows[8],
],
[ '--sleep', '0', '--before', '20060123210426', '-q' ]
],
$allRows[3],
$allRows[4],
$allRows[6],
+ $allRows[8],
],
[ '--sleep', '0', '--check-old', '-q' ]
],