r114394 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114393‎ | r114394 | r114395 >
Date:19:25, 21 March 2012
Author:catrope
Status:ok
Tags:
Comment:
Revert r113364, r113598, r113604, r113793, r113795. Unreviewed changes in Nuke.

All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
Modified paths:
  • /trunk/extensions/Nuke/Nuke.i18n.php (modified) (history)
  • /trunk/extensions/Nuke/Nuke.php (modified) (history)
  • /trunk/extensions/Nuke/Nuke_body.php (modified) (history)
  • /trunk/extensions/Nuke/RELEASE-NOTES (modified) (history)

Diff [purge]

Index: trunk/extensions/Nuke/Nuke_body.php
@@ -7,18 +7,14 @@
88 }
99
1010 public function execute( $par ) {
11 - if ( !$this->userCanExecute( $this->getUser() ) ) {
 11+ if( !$this->userCanExecute( $this->getUser() ) ) {
1212 $this->displayRestrictionError();
 13+ return;
1314 }
 15+
1416 $this->setHeaders();
1517 $this->outputHeader();
1618
17 - if ( $this->getUser()->isBlocked() ) {
18 - $block = $this->getUser()->getBlock();
19 - throw new UserBlockedError( $block );
20 - }
21 - $this->checkReadOnly();
22 -
2319 $req = $this->getRequest();
2420
2521 $target = trim( $req->getText( 'target', $par ) );
@@ -165,13 +161,11 @@
166162 /**
167163 * @var $title Title
168164 */
169 - list( $title, $userName, $edits ) = $info;
 165+ list( $title, $userName ) = $info;
170166
171167 $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false;
172168 $thumb = $image && $image->exists() ? $image->transform( array( 'width' => 120, 'height' => 120 ), 0 ) : false;
173169
174 - $changes = wfMsgExt( 'nchanges', 'parsemag', $this->getLanguage()->formatNum( $edits ) );
175 -
176170 $out->addHTML( '<li>' .
177171 Xml::check(
178172 'pages[]',
@@ -185,7 +179,7 @@
186180 ( $userName ? wfMsgExt( 'nuke-editby', 'parseinline', $userName ) . ',&#160;' : '' ) .
187181 Linker::linkKnown(
188182 $title,
189 - $changes,
 183+ wfMsg( 'nuke-viewchanges' ),
190184 array(),
191185 array( 'action' => 'history' )
192186 ) .
@@ -210,29 +204,13 @@
211205 protected function getNewPages( $username, $limit ) {
212206 $dbr = wfGetDB( DB_SLAVE );
213207
214 - /**
215 - * This is the worst-case query:
216 - *
217 - * SELECT rc_user_text, rc_namespace, rc_title, SUM(1) AS edits, MAX(rc_new)
218 - * FROM recentchanges
219 - * WHERE (rc_log_type IS NULL OR (rc_log_type = 'upload' AND rc_log_action='upload'))
220 - * AND rc_title LIKE 'Test%'
221 - * GROUP BY rc_user_text, rc_namespace, rc_title
222 - * HAVING MIN(CASE
223 - * WHEN rc_log_type IS NULL THEN 2
224 - * WHEN rc_log_type = 'upload' THEN 1
225 - * ELSE 0 END) = 1
226 - * OR MAX(rc_new) = 1
227 - * ORDER BY min(rc_timestamp) DESC;
228 - *
229 - */
230 -
231208 $what = array(
232209 'rc_namespace',
233210 'rc_title',
 211+ 'rc_timestamp',
234212 );
235213
236 - $where = array( "(rc_log_type IS NULL) OR (rc_log_type = 'upload' AND rc_log_action = 'upload')" );
 214+ $where = array( "(rc_new = 1) OR (rc_log_type = 'upload' AND rc_log_action = 'upload')" );
237215
238216 if ( $username === '' ) {
239217 $what[] = 'rc_user_text';
@@ -244,23 +222,15 @@
245223 if ( !is_null( $pattern ) && trim( $pattern ) !== '' ) {
246224 $where[] = 'rc_title LIKE ' . $dbr->addQuotes( $pattern );
247225 }
248 - $group = implode( ', ', $what );
249 - $what[] = "sum(1) AS edits";
250226
251227 $result = $dbr->select( 'recentchanges',
252228 $what,
253229 $where,
254230 __METHOD__,
255231 array(
256 - 'GROUP BY' => $group,
257 - 'LIMIT' => $limit,
258 - 'ORDER BY' => 'MIN(rc_timestamp) DESC',
259 - 'HAVING' => <<<QUERY
260 - MIN(CASE WHEN rc_log_type IS NULL THEN 2
261 - WHEN rc_log_type = 'upload' THEN 1
262 - ELSE 0 END) = 1
263 - OR MAX(rc_new) = 1
264 -QUERY
 232+ 'ORDER BY' => 'rc_timestamp DESC',
 233+ 'GROUP BY' => 'rc_namespace, rc_title',
 234+ 'LIMIT' => $limit
265235 )
266236 );
267237
@@ -269,8 +239,7 @@
270240 foreach ( $result as $row ) {
271241 $pages[] = array(
272242 Title::makeTitle( $row->rc_namespace, $row->rc_title ),
273 - $username === '' ? $row->rc_user_text : false,
274 - $row->edits,
 243+ $username === '' ? $row->rc_user_text : false
275244 );
276245 }
277246
@@ -290,12 +259,6 @@
291260 $title = Title::newFromURL( $page );
292261 $file = $title->getNamespace() == NS_FILE ? wfLocalFile( $title ) : false;
293262
294 - $permission_errors = $title->getUserPermissionsErrors( 'delete', $this->getUser());
295 -
296 - if ( count( $permission_errors )) {
297 - throw new PermissionsError( 'delete', $permission_errors );
298 - }
299 -
300263 if ( $file ) {
301264 $oldimage = null; // Must be passed by reference
302265 $ok = FileDeleteForm::doDelete( $title, $file, $oldimage, $reason, false )->isOK();
Index: trunk/extensions/Nuke/Nuke.i18n.php
@@ -37,6 +37,7 @@
3838 'nuke-delete-more' => '[[Special:Nuke|Delete more pages]]',
3939 'nuke-pattern' => 'Pattern for the page name:',
4040 'nuke-nopages-global'=> 'There are no new pages in [[Special:RecentChanges|recent changes]].',
 41+ 'nuke-viewchanges' => 'view changes',
4142 );
4243
4344 /** Message documentation (Message documentation)
@@ -195,6 +196,7 @@
196197 'nuke-delete-more' => '[[Special:Nuke|Desaniciar más páxines]]',
197198 'nuke-pattern' => 'Patrón pal nome de páxina:',
198199 'nuke-nopages-global' => 'Nun hai páxines nueves nos [[Special:RecentChanges|cambios recientes]].',
 200+ 'nuke-viewchanges' => 'ver los cambios',
199201 );
200202
201203 /** Azerbaijani (Azərbaycanca)
@@ -286,6 +288,7 @@
287289 'nuke-delete-more' => '[[Special:Nuke|Масавае выдаленьне старонак]]',
288290 'nuke-pattern' => 'Узор для назвы старонкі:',
289291 'nuke-nopages-global' => 'У [[Special:RecentChanges|апошніх зьменах]] больш няма новых старонак.',
 292+ 'nuke-viewchanges' => 'праглядзець зьмены',
290293 );
291294
292295 /** Bulgarian (Български)
@@ -353,6 +356,7 @@
354357 'nuke-delete-more' => '[[Special:Nuke|Diverkañ pajennoù all]]',
355358 'nuke-pattern' => 'Patrom evit anv ar bajenn :',
356359 'nuke-nopages-global' => "N'eus pajenn nevez ebet er [[Special:RecentChanges|c'hemmoù diwezhañ]].",
 360+ 'nuke-viewchanges' => "Diskouez ar c'hemmoù",
357361 );
358362
359363 /** Bosnian (Bosanski)
@@ -505,6 +509,7 @@
506510 'nuke-delete-more' => '[[Special:Nuke|Weitere Seiten löschen]]',
507511 'nuke-pattern' => 'Muster für den Seitennamen:',
508512 'nuke-nopages-global' => 'Es gibt keine neuen Seiten unter den [[Special:RecentChanges|letzten Änderungen]].',
 513+ 'nuke-viewchanges' => 'Änderungen ansehen',
509514 );
510515
511516 /** German (formal address) (‪Deutsch (Sie-Form)‬)
@@ -564,6 +569,7 @@
565570 'nuke-delete-more' => '[[Special:Nuke|Dalšne boki lašowaś]]',
566571 'nuke-pattern' => 'Pśikład za bokowe mě:',
567572 'nuke-nopages-global' => 'Njejsu žedne nowe boki w [[Special:RecentChanges|aktualnych změnach]].',
 573+ 'nuke-viewchanges' => 'změny pokazaś',
568574 );
569575
570576 /** Ewe (Eʋegbe) */
@@ -662,6 +668,7 @@
663669 'nuke-delete-more' => '[[Special:Nuke|Borrar más páginas]]',
664670 'nuke-pattern' => 'Patrón del título de la página:',
665671 'nuke-nopages-global' => 'No hay nuevas páginas en los [[Special:RecentChanges|cambios recientes]].',
 672+ 'nuke-viewchanges' => 'Mostrar cambios',
666673 );
667674
668675 /** Estonian (Eesti)
@@ -734,6 +741,7 @@
735742 'nuke-delete-more' => '[[Special:Nuke|حذف صفحه‌های بیشتر]]',
736743 'nuke-pattern' => 'الگو برای نام صفحه:',
737744 'nuke-nopages-global' => 'هیچ صفحهٔ جدیدی در [[Special:RecentChanges|فهرست تغییرات اخیر]] نیست.',
 745+ 'nuke-viewchanges' => 'نمایش تغییرات',
738746 );
739747
740748 /** Finnish (Suomi)
@@ -805,6 +813,7 @@
806814 'nuke-delete-more' => '[[Special:Nuke|Supprimer plus de pages]]',
807815 'nuke-pattern' => 'Modèle pour le nom de page:',
808816 'nuke-nopages-global' => "Il n'y a pas de nouvelle page dans [[Special:RecentChanges|changements récents]].",
 817+ 'nuke-viewchanges' => 'voir les modifications',
809818 );
810819
811820 /** Franco-Provençal (Arpetan)
@@ -874,6 +883,7 @@
875884 'nuke-delete-more' => '[[Special:Nuke|Borrar máis páxinas]]',
876885 'nuke-pattern' => 'Patrón para o nome de páxina:',
877886 'nuke-nopages-global' => 'Non hai páxinas novas nos [[Special:RecentChanges|cambios recentes]].',
 887+ 'nuke-viewchanges' => 'ollar os cambios',
878888 );
879889
880890 /** Ancient Greek (Ἀρχαία ἑλληνικὴ)
@@ -957,6 +967,7 @@
958968 'nuke-delete-more' => '[[Special:Nuke|למחוק עוד דפים]]',
959969 'nuke-pattern' => 'תבנית עבור שם הדף:',
960970 'nuke-nopages-global' => 'אין דפים חדשים ב[[Special:RecentChanges|שינויים אחרונים]].',
 971+ 'nuke-viewchanges' => 'הצגת שינויים',
961972 );
962973
963974 /** Hindi (हिन्दी)
@@ -1032,6 +1043,7 @@
10331044 'nuke-delete-more' => '[[Special:Nuke|Dalše strony wušmórnyć]]',
10341045 'nuke-pattern' => 'Přikład za mjeno strony:',
10351046 'nuke-nopages-global' => 'Njejsu žane nowe strony w [[Special:RecentChanges|aktualnych změnach]].',
 1047+ 'nuke-viewchanges' => 'změny pokazać',
10361048 );
10371049
10381050 /** Hungarian (Magyar)
@@ -1087,6 +1099,7 @@
10881100 'nuke-delete-more' => '[[Special:Nuke|Deler plus paginas]]',
10891101 'nuke-pattern' => 'Patrono pro le nomine de pagina:',
10901102 'nuke-nopages-global' => 'Il non ha nove paginas in le [[Special:RecentChanges|modificationes recente]].',
 1103+ 'nuke-viewchanges' => 'vider modificationes',
10911104 );
10921105
10931106 /** Indonesian (Bahasa Indonesia)
@@ -1221,6 +1234,7 @@
12221235 'nuke-delete-more' => '[[Special:Nuke|Cancella più pagine]]',
12231236 'nuke-pattern' => 'Modello per il titolo della pagina:',
12241237 'nuke-nopages-global' => 'Non ci sono nuove pagine negli [[Special:RecentChanges|ultimi cambiamenti]].',
 1238+ 'nuke-viewchanges' => 'vedi modifiche',
12251239 );
12261240
12271241 /** Japanese (日本語)
@@ -1443,6 +1457,7 @@
14441458 'nuke-delete-more' => '[[Special:Nuke|Méi Säite läschen]]',
14451459 'nuke-pattern' => 'Muster fir de Säitennumm:',
14461460 'nuke-nopages-global' => 'Et si keng nei Säiten an de [[Special:RecentChanges|rezenten Ännerungen]].',
 1461+ 'nuke-viewchanges' => 'Ännerunge weisen',
14471462 );
14481463
14491464 /** Limburgish (Limburgs)
@@ -1535,6 +1550,7 @@
15361551 'nuke-delete-more' => '[[Special:Nuke|Избриши уште страници]]',
15371552 'nuke-pattern' => 'Мостра за име на страница:',
15381553 'nuke-nopages-global' => 'Нема нови страници во [[Special:RecentChanges|скорешните промени]].',
 1554+ 'nuke-viewchanges' => 'прикажи промени',
15391555 );
15401556
15411557 /** Malayalam (മലയാളം)
@@ -1610,6 +1626,7 @@
16111627 'nuke-delete-more' => '[[Special:Nuke|Hapuskan lebih banyak laman]]',
16121628 'nuke-pattern' => 'Pola nama laman:',
16131629 'nuke-nopages-global' => 'Tiada laman baru dalam [[Special:RecentChanges|perubahan terkini]].',
 1630+ 'nuke-viewchanges' => 'lihat perubahan',
16141631 );
16151632
16161633 /** Maltese (Malti)
@@ -1746,6 +1763,7 @@
17471764 'nuke-delete-more' => "[[Special:Nuke|Meer pagina's verwijderen]]",
17481765 'nuke-pattern' => 'Patroon voor de paginanaam:',
17491766 'nuke-nopages-global' => "Er zijn geen nieuwe pagina's in de [[Special:RecentChanges|recente wijzigingen]].",
 1767+ 'nuke-viewchanges' => 'wijzigingen bekijken',
17501768 );
17511769
17521770 /** Norwegian Nynorsk (‪Norsk (nynorsk)‬)
@@ -1868,6 +1886,7 @@
18691887 'nuke-delete-more' => '[[Special:Nuke|Usuń więcej stron]]',
18701888 'nuke-pattern' => 'Wzór nazwy strony:',
18711889 'nuke-nopages-global' => 'Brak nowych stron w [[Special:RecentChanges|ostatnich zmianach]].',
 1890+ 'nuke-viewchanges' => 'widok zmian',
18721891 );
18731892
18741893 /** Piedmontese (Piemontèis)
@@ -1898,6 +1917,7 @@
18991918 'nuke-delete-more' => "[[Special:Nuke|Scancelé pì 'd pàgine]]",
19001919 'nuke-pattern' => 'Model për ël nòm ëd pàgina:',
19011920 'nuke-nopages-global' => "A-i é pa 'd pàgine neuve an [[Special:RecentChanges|ùltime modìfiche]].",
 1921+ 'nuke-viewchanges' => 'varda modìfiche',
19021922 );
19031923
19041924 /** Pashto (پښتو)
@@ -2090,6 +2110,7 @@
20912111 'nuke-delete-more' => '[[Special:Nuke|Множественное удаление страниц]]',
20922112 'nuke-pattern' => 'Шаблон для имени страницы:',
20932113 'nuke-nopages-global' => 'В [[Special:RecentChanges|недавних изменениях]] нет новых страниц.',
 2114+ 'nuke-viewchanges' => 'Внесённые изменения',
20942115 );
20952116
20962117 /** Rusyn (Русиньскый)
@@ -2230,6 +2251,7 @@
22312252 'nuke-delete-more' => '[[Special:Nuke|Izbriši več strani]]',
22322253 'nuke-pattern' => 'Vzorec imena strani:',
22332254 'nuke-nopages-global' => 'V [[Special:RecentChanges|zadnjih spremembah]] ni novih strani.',
 2255+ 'nuke-viewchanges' => 'ogled sprememb',
22342256 );
22352257
22362258 /** Serbian (Cyrillic script) (‪Српски (ћирилица)‬)
@@ -2558,6 +2580,7 @@
25592581 'nuke-delete-more' => '[[Special:Nuke|Xóa thêm trang]]',
25602582 'nuke-pattern' => 'Mẫu tên trang:',
25612583 'nuke-nopages-global' => 'Không có trang mới trong các [[Special:RecentChanges|thay đổi gần đây]].',
 2584+ 'nuke-viewchanges' => 'xem thay đổi',
25622585 );
25632586
25642587 /** Volapük (Volapük)
Index: trunk/extensions/Nuke/RELEASE-NOTES
@@ -1,14 +1,10 @@
22 These are the release notes for the Nuke extension.
3 -
 3+
44 Extension page on mediawiki.org: https://www.mediawiki.org/wiki/Extension:Nuke
55 Latest version of the release notes: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Nuke/RELEASE-NOTES?view=co
66
7 -=== Version 1.1.5 ==
8 -(2012-03-14)
9 -* (bug 35214) Special:Nuke allows deletions even when blocked
10 -* (bug 16985) Show number of recent edits in Special:Nuke
11 -* (bug 23600) Nuke extension w/PostgreSQL: column "recentchanges.rc_timestamp" should be in GROUP BY
127
 8+
139 === Version 1.1.4 ===
1410 (2012-2-12)
1511
@@ -37,4 +33,4 @@
3834 === Version 1.1 ===
3935 (2011-2-14)
4036
41 -* Added a changable limit and the option to not filter the recent changes on a single user.
 37+* Added a changable limit and the option to not filter the recent changes on a single user.
\ No newline at end of file
Index: trunk/extensions/Nuke/Nuke.php
@@ -4,7 +4,7 @@
55 die( 'Not an entry point.' );
66 }
77
8 -define( 'Nuke_VERSION', '1.1.5' );
 8+define( 'Nuke_VERSION', '1.1.4' );
99
1010 $dir = dirname(__FILE__) . '/';
1111
@@ -15,7 +15,7 @@
1616 'path' => __FILE__,
1717 'name' => 'Nuke',
1818 'descriptionmsg' => 'nuke-desc',
19 - 'author' => array( 'Brion Vibber', 'Jeroen De Dauw', 'Marcin Cieślak' ),
 19+ 'author' => array( 'Brion Vibber', 'Jeroen De Dauw' ),
2020 'url' => 'https://www.mediawiki.org/wiki/Extension:Nuke',
2121 'version' => Nuke_VERSION,
2222 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113364Fix bug 23600: column "recentchanges.rc_timestamp" should be in GROUP BY...saper13:28, 8 March 2012
r113598Followup to rr113364: Sometimessaper22:58, 11 March 2012
r113604bug 16985: Show number of recent edits in Special:Nuke...saper00:18, 12 March 2012
r113793(bug 35214) Special:Nuke allows deletions even when blockedsaper01:58, 14 March 2012
r113795Followup-To: r113793 Update RELEASE-NOTES for Extension:Nuke version 1.1.5saper02:24, 14 March 2012

Status & tagging log