Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1368,16 +1368,6 @@ |
1369 | 1369 | hook to remove a core special page |
1370 | 1370 | $list: list (array) of core special pages |
1371 | 1371 | |
1372 | | -'SpecialRandomBeforeSQL': called before building the SQL statement for |
1373 | | -Special:Random and all subclasses |
1374 | | -$page: The RandomPage object |
1375 | | -&$ns: Comma separated list of namespaces used in the query |
1376 | | -&$redirect: 1 or 0, whether to retrieve a redirect or a non-redirect |
1377 | | -&$extra: Extra SQL statements in the WHERE clause, after checking |
1378 | | -$wgExtraRandompageSQL and after subclasses add extra clauses |
1379 | | -&$sql: The query used if the hook returns false, must select |
1380 | | -page_namespace and page_title |
1381 | | - |
1382 | 1372 | 'SpecialRecentChangesPanel': called when building form options in |
1383 | 1373 | SpecialRecentChanges |
1384 | 1374 | &$extraOpts: array of added items, to which can be added |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2809,10 +2809,7 @@ |
2810 | 2810 | /** Use the site's Cascading Style Sheets (CSS)? */ |
2811 | 2811 | $wgUseSiteCss = true; |
2812 | 2812 | |
2813 | | -/** |
2814 | | - * Filter for Special:Randompage. Part of a WHERE clause |
2815 | | - * @deprecated as of 1.16, use the SpecialRandomBeforeSQL hook |
2816 | | -*/ |
| 2813 | +/** Filter for Special:Randompage. Part of a WHERE clause */ |
2817 | 2814 | $wgExtraRandompageSQL = false; |
2818 | 2815 | |
2819 | 2816 | /** Allow the "info" action, very inefficient at the moment */ |
Index: trunk/phase3/includes/specials/SpecialRandompage.php |
— | — | @@ -89,23 +89,20 @@ |
90 | 90 | |
91 | 91 | $extra = $wgExtraRandompageSQL ? "AND ($wgExtraRandompageSQL)" : ""; |
92 | 92 | $extra .= $this->addExtraSQL() ? "AND (".$this->addExtraSQL().")" : ""; |
93 | | - $sql = ''; |
94 | | - if ( wfRunHooks( 'SpecialRandomBeforeSQL', array( $this, &$ns, &$redirect, &$extra, &$sql ) ) ) { |
95 | | - $sql = "SELECT page_title, page_namespace |
96 | | - FROM $page $use_index |
97 | | - WHERE page_namespace IN ( $ns ) |
98 | | - AND page_is_redirect = $redirect |
99 | | - AND page_random >= $randstr |
100 | | - $extra |
101 | | - ORDER BY page_random"; |
| 93 | + $sql = "SELECT page_title, page_namespace |
| 94 | + FROM $page $use_index |
| 95 | + WHERE page_namespace IN ( $ns ) |
| 96 | + AND page_is_redirect = $redirect |
| 97 | + AND page_random >= $randstr |
| 98 | + $extra |
| 99 | + ORDER BY page_random"; |
102 | 100 | |
103 | | - $sql = $dbr->limitResult( $sql, 1, 0 ); |
104 | | - } |
| 101 | + $sql = $dbr->limitResult( $sql, 1, 0 ); |
105 | 102 | $res = $dbr->query( $sql, __METHOD__ ); |
106 | 103 | return $dbr->fetchObject( $res ); |
107 | 104 | } |
108 | 105 | |
109 | | - // an alternative to $wgExtraRandompageSQL so subclasses |
| 106 | + // an alternative to $wgExtraRandompageSQL so extensions |
110 | 107 | // can add their own SQL by overriding this function |
111 | 108 | public function addExtraSQL() { |
112 | 109 | return ''; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -79,8 +79,6 @@ |
80 | 80 | to control which external domains may access the API via cross-site AJAX. |
81 | 81 | * $wgMaintenanceScripts for extensions to add their scripts to the default list |
82 | 82 | * $wgMemoryLimit has been added, default value '50M' |
83 | | -* $wgExtraRandompageSQL is deprecated, the SpecialRandomBeforeSQL hook should |
84 | | - be used instead |
85 | 83 | |
86 | 84 | === New features in 1.16 === |
87 | 85 | |
— | — | @@ -194,9 +192,6 @@ |
195 | 193 | numbers outside the permitted ranges), etc. |
196 | 194 | ** The summary attribute has been removed from tables of contents. summary is |
197 | 195 | obsolete in HTML 5 and wasn't useful here anyway. |
198 | | -* New hook SpecialRandomBeforeSQL allows extensions to modify or replace the SQL |
199 | | - query used in Special:Random and subclasses, deprecating the $wgExtraRandompageSQL |
200 | | - config variable |
201 | 196 | |
202 | 197 | === Bug fixes in 1.16 === |
203 | 198 | |