Last modified: 2012-04-23 13:37:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37388, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35388 - DisableSpecialPages incompatible with MediaWiki 1.18.1
DisableSpecialPages incompatible with MediaWiki 1.18.1
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Other (Other open bugs)
unspecified
Other Windows 7
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-21 16:42 UTC by Max
Modified: 2012-04-23 13:37 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Max 2012-03-21 16:42:00 UTC
It works fine with 1.17.0 but after upgrading to 1.18.1 I got this error: 


Fatal error: Maximum function nesting level of '500' reached, aborting! in \extensions\DisableSpecialPages\DisableSpecialPages.php on line 216

It's not the whole stack trace because it's redundant:

#	Time	Memory	Function	Location
1	0.0008	370456	{main}( )	..\index.php:0
2	0.1432	10861856	MediaWiki->run( )	..\index.php:57
3	0.1433	10861856	MediaWiki->main( )	..\Wiki.php:547
4	0.1433	10861904	MediaWiki->performRequest( )	..\Wiki.php:640
5	0.1434	10862088	Title->isSpecial( )	..\Wiki.php:155
6	0.1445	10993192	SpecialPageFactory::resolveAlias( )	..\Title.php:4120
7	0.1445	10993472	SpecialPageFactory::getAliasList( )	..\SpecialPageFactory.php:242
8	0.1459	11078072	SpecialPageFactory::getList( )	..\SpecialPageFactory.php:209
9	0.1460	11080304	wfRunHooks( )	..\SpecialPageFactory.php:185
10	0.1460	11080304	Hooks::run( )	..\GlobalFunctions.php:3631
11	0.1460	11085184	call_user_func_array ( )	..\Hooks.php:216
12	0.1460	11085368	efDspHook( )	..\Hooks.php:216
13	0.1502	11858552	SpecialPage::resolveAlias( )	..\DisableSpecialPages.php:39
14	0.1502	11858552	SpecialPageFactory::resolveAlias( )	..\SpecialPage.php:89
15	0.1502	11858832	SpecialPageFactory::getAliasList( )	..\SpecialPageFactory.php:242
16	0.1503	11858832	SpecialPageFactory::getList( )	..\SpecialPageFactory.php:209
17	0.1503	11859064	wfRunHooks( )	..\SpecialPageFactory.php:185
18	0.1503	11859064	Hooks::run( )	..\GlobalFunctions.php:3631
19	0.1504	11863960	call_user_func_array ( )	..\Hooks.php:216
20	0.1504	11864144	efDspHook( )	..\Hooks.php:216
21	0.1505	11866248	SpecialPage::resolveAlias( )	..\DisableSpecialPages.php:39
22	0.1505	11866248	SpecialPageFactory::resolveAlias( )	..\SpecialPage.php:89
23	0.1505	11866528	SpecialPageFactory::getAliasList( )	..\SpecialPageFactory.php:242
24	0.1505	11866528	SpecialPageFactory::getList( )	..\SpecialPageFactory.php:209
25	0.1506	11866760	wfRunHooks( )	..\SpecialPageFactory.php:185
26	0.1506	11866760	Hooks::run( )	..\GlobalFunctions.php:3631
27	0.1506	11871656	call_user_func_array ( )	..\Hooks.php:216
28	0.1506	11871840	efDspHook( )	..\Hooks.php:216
29	0.1507	11873944	SpecialPage::resolveAlias( )	..\DisableSpecialPages.php:39
30	0.1507	11873944	SpecialPageFactory::resolveAlias( )	..\SpecialPage.php:89
31	0.1508	11874224	SpecialPageFactory::getAliasList( )	..\SpecialPageFactory.php:242
32	0.1508	11874224	SpecialPageFactory::getList( )	..\SpecialPageFactory.php:209
33	0.1508	11874456	wfRunHooks( )	..\SpecialPageFactory.php:185
34	0.1508	11874456	Hooks::run( )	..\GlobalFunctions.php:3631
Comment 1 Max 2012-04-23 13:37:51 UTC
See here the solution I found:

http://www.mediawiki.org/wiki/Extension_talk:DisableSpecialPages


I found out what's causing the infinite loop: <code>SpecialPage::resolveAlias</code> has been deprecated since 1.18 Instead you should use <code>SpecialPageFactory::resolveAlias</code>. Problem is this has the following stack:
<pre>SpecialPageFactory::resolveAlias --> SpecialPageFactory::getAliasList --> SpecialPageFactory::getList --> wfRunHooks( 'SpecialPage_initList', array( &self::$mList ) );</pre> 

So it's pretty obvious what the problem is. I don't see why we need the canonical name, because if you look [[Manual:Special_pages#Disabling_Special:UserLogin_and_Special:UserLogout_pages|here]] it's pretty clear how to disable built-in special pages.
I made the following changes in order to make it work with 1.18.2:
* removed this function, not needed: <code>efDspMakeTitle()</code>
* new version of <code>efDspHook()</code>:
<pre>
function efDspHook( &$aSpecialPages ) {
	global $wgDisabledSpecialPages;
  if ( !empty ( $wgDisabledSpecialPages ) ) {
    foreach( $wgDisabledSpecialPages as $page ) {
      if( !efDspWhitelisted( $page ) && isset( $aSpecialPages[$page] ) )
        unset( $aSpecialPages[$page] );
    }
  }
	return true;
}
</pre>

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links