r81247 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81246‎ | r81247 | r81248 >
Date:13:02, 31 January 2011
Author:reedy
Status:reverted (Comments)
Tags:
Comment:
This extension fucking sucks. Seriously, how are you including special pages?

Commiting change to using $wgSpecialPages[] = '';

Will come back and look at tidying up the crap that it brings


/me facepalms
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialAddCollection.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialConceptMapping.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialCopy.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialDatasearch.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialExportTSV.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialImportLangNames.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialImportTSV.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialNeedsTranslation.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialOWStatistics.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialSelect.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialSuggest.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialTransaction.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/SpecialDatasearch.php
@@ -3,6 +3,7 @@
44 if ( !defined( 'MEDIAWIKI' ) ) die();
55
66 $wgExtensionFunctions[] = 'wfSpecialDatasearch';
 7+$wgSpecialPages[] = 'SpecialDatasearch';
78
89 require_once( "Wikidata.php" );
910 require_once( "WikiDataGlobals.php" );
@@ -360,6 +361,4 @@
361362 return $editor;
362363 }
363364 }
364 -
365 - SpecialPage::addPage( new SpecialDatasearch() );
366365 }
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialImportLangNames.php
@@ -6,6 +6,9 @@
77 $wgAvailableRights[] = 'languagenames';
88
99 $wgExtensionFunctions[] = 'wfSpecialImportLangNames';
 10+
 11+ $wgSpecialPages[] = 'SpecialImportLangNames';
 12+
1013 function wfSpecialImportLangNames() {
1114 class SpecialImportLangNames extends SpecialPage {
1215 function SpecialImportLangNames() {
@@ -157,7 +160,5 @@
158161 }
159162
160163 }
161 -
162 - SpecialPage::addPage( new SpecialImportLangNames );
163164 }
164165
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialAddCollection.php
@@ -7,6 +7,7 @@
88 $wgAvailableRights[] = 'addcollection';
99 $wgGroupPermissions['bureaucrat']['addcollection'] = true;
1010 $wgExtensionFunctions[] = 'wfSpecialAddCollection';
 11+ $wgSpecialPages[] = 'SpecialAddCollection';
1112
1213 function wfSpecialAddCollection() {
1314 class SpecialAddCollection extends SpecialPage {
@@ -54,7 +55,5 @@
5556 ) );
5657 }
5758 }
58 -
59 - SpecialPage::addPage( new SpecialAddCollection );
6059 }
6160
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialNeedsTranslation.php
@@ -3,6 +3,8 @@
44
55 $wgExtensionFunctions[] = 'wfSpecialNeedsTranslation';
66
 7+ $wgSpecialPages[] = 'SpecialNeedsTranslation';
 8+
79 require_once( "Wikidata.php" );
810
911 function wfSpecialNeedsTranslation() {
@@ -149,8 +151,6 @@
150152 $wgOut->addHTML( $editor->view( new IdStack( "expression" ), $recordSet ) );
151153 }
152154 }
153 -
154 - SpecialPage::addPage( new SpecialNeedsTranslation );
155155 }
156156
157157
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialExportTSV.php
@@ -8,6 +8,8 @@
99 $wgAvailableRights[] = 'exporttsv';
1010 $wgExtensionFunctions[] = 'wfSpecialExportTSV';
1111
 12+ $wgSpecialPages[] = 'SpecialExportTSV';
 13+
1214 function wfSpecialExportTSV() {
1315 class SpecialExportTSV extends SpecialPage {
1416
@@ -266,7 +268,5 @@
267269 return $fileName;
268270 }
269271 }
270 -
271 - SpecialPage::addPage( new SpecialExportTSV );
272272 }
273273
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialSelect.php
@@ -6,6 +6,7 @@
77 require_once( "Wikidata.php" );
88 require_once( "WikiDataGlobals.php" );
99
 10+$wgSpecialPages[] = 'SpecialSelect';
1011
1112 function wfSpecialSelect() {
1213 class SpecialSelect extends SpecialPage {
@@ -24,8 +25,6 @@
2526 echo getSelectOptions();
2627 }
2728 }
28 -
29 - SpecialPage::addPage( new SpecialSelect() );
3029 }
3130
3231 function getSelectOptions() {
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialSuggest.php
@@ -4,6 +4,8 @@
55
66
77 $wgExtensionFunctions[] = 'wfSpecialSuggest';
 8+$wgSpecialPages[] = 'SpecialSuggest';
 9+
810 function wfSpecialSuggest() {
911 class SpecialSuggest extends SpecialPage {
1012 function SpecialSuggest() {
@@ -32,8 +34,6 @@
3335 echo getSuggestions();
3436 }
3537 }
36 -
37 - SpecialPage::addPage( new SpecialSuggest() );
3838 }
3939
4040 /**
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialTransaction.php
@@ -3,6 +3,8 @@
44 if ( !defined( 'MEDIAWIKI' ) ) die();
55
66 $wgExtensionFunctions[] = 'wfSpecialTransaction';
 7+$wgSpecialPages[] = 'SpecialTransaction';
 8+
79 require_once( "Wikidata.php" );
810 require_once( "Utilities.php" );
911
@@ -90,8 +92,6 @@
9193 $wgOut->addHTML( "<script language='javascript'>/* <![CDATA[ */\nexpandEditors();\n/* ]]> */</script>" );
9294 }
9395 }
94 -
95 - SpecialPage::addPage( new SpecialTransaction() );
9696 }
9797
9898 function getFilterOptionsPanel( $fromTransactionId, $transactionCount, $userName, $showRollBackOptions ) {
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialOWStatistics.php
@@ -3,6 +3,8 @@
44
55 $wgExtensionFunctions[] = 'wfSpecialOWStatistics';
66
 7+ $wgSpecialPages[] = 'SpecialOWStatistics';
 8+
79 require_once( "Wikidata.php" );
810 require_once( 'languages.php' );
911
@@ -255,6 +257,4 @@
256258 }
257259
258260 }
259 - SpecialPage::addPage( new SpecialOWStatistics );
260 -
261261 }
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialImportTSV.php
@@ -8,6 +8,8 @@
99 $wgAvailableRights[] = 'importtsv';
1010 $wgExtensionFunctions[] = 'wfSpecialImportTSV';
1111
 12+ $wgSpecialPages[] = 'SpecialImportTSV';
 13+
1214 function wfSpecialImportTSV() {
1315 class SpecialImportTSV extends SpecialPage {
1416
@@ -239,7 +241,5 @@
240242 }
241243
242244 }
243 -
244 - SpecialPage::addPage( new SpecialImportTSV );
245245 }
246246
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialConceptMapping.php
@@ -18,6 +18,8 @@
1919 'author' => 'Kim Bruning',
2020 );
2121
 22+$wgSpecialPages[] = 'SpecialConceptMapping';
 23+
2224 function wfSpecialConceptMapping() {
2325 require_once( "Wikidata.php" );
2426 require_once( "WikiDataAPI.php" );
@@ -198,8 +200,5 @@
199201 }
200202
201203 }
202 -
203 - SpecialPage::addPage( new SpecialConceptMapping );
204 -
205204 }
206205
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialCopy.php
@@ -23,6 +23,8 @@
2424 'author' => 'Alan Smithee',
2525 );
2626
 27+$wgSpecialPages[] = 'SpecialCopy';
 28+
2729 function wfSpecialCopy() {
2830 require_once( "Wikidata.php" );
2931 require_once( "WikiDataAPI.php" );
@@ -170,7 +172,5 @@
171173
172174 }
173175 }
174 - SpecialPage::addPage( new SpecialCopy );
175 -
176176 }
177177

Follow-up revisions

RevisionCommit summaryAuthorDate
r81249Reverting r81247, I really CBAreedy13:38, 31 January 2011

Comments

#Comment by 😂 (talk | contribs)   13:11, 31 January 2011

This extension sucks...every time I grep for old code and find stuff in this extension I just ignore it. It's so broken it's not even funny.

#Comment by Reedy (talk | contribs)   13:18, 31 January 2011

Why is it still around? :(

#Comment by 😂 (talk | contribs)   13:29, 31 January 2011

Somebody still cares about it?

Delete it and I'm sure you'll find out who ;-)

#Comment by Reedy (talk | contribs)   13:35, 31 January 2011

It's barely been touched in the last year bar deprecated code updates...

Nearly 2 since anything functional done to it...

#Comment by Nikerabbit (talk | contribs)   13:43, 31 January 2011

Doesn't that apply to most of our extensions?

#Comment by Siebrand (talk | contribs)   13:43, 31 January 2011

omegawiki.org is still up and running using this code. Updates are appreciated.

#Comment by Siebrand (talk | contribs)   13:45, 31 January 2011

Oh, no reason for foul language in commit summaries as far as I can see...

#Comment by 😂 (talk | contribs)   13:47, 31 January 2011

Agreed. There's a big difference between "using old coding styles (that were perfectly valid at the time)" and actually writing shitty code.

#Comment by Siebrand (talk | contribs)   13:51, 31 January 2011

Well, for the Wikidata extensions, I'm sure that a case can be made so that both bad properties apply; but still... I'd like to kep it at Sam having a bad day (also see bug 27020).

#Comment by Siebrand (talk | contribs)   13:54, 31 January 2011

Make that bug 27070. Dang, why can't I edit my CR comments?

Status & tagging log