I need to use an older Mediawiki extension on our site, that isn't maintained anymore. When I activate the extension I get the following Error: 'Call to undefined method SpecialPage::addPage()' As far as I found out, this is due to the fact, that in Mediawiki since version 1.25 they changed the way how new Special pages are created and registered. I could not find examples that showed how to fix the code from an older extension so that it could work in the actual version of MW.
Here is the relevant code of the extension where the SpecialPage is created and registered.
require_once( './includes/specialpage/SpecialPage.php' );
$wgSpecialPages['Events'] = new SpecialPage ( 'Events' );
$wgExtensionFunctions[] = 'efEventsExtn';
$wgExtensionCredits['specialpage'][] = array(
'name' => 'Events',
'author' => 'Barrylb',
'description' => 'Adds [[Special:Events|a special page]] for viewing events',
'url' => 'http://www.mediawiki.org/wiki/Extension:Calendar_%28Barrylb%29'
);
function efEventsExtn() {
$wgamMessages = array();
SpecialPage::addPage( new EventsExtn() );
$wgamMessages = array( 'events' => 'Events' , 'events-header' => '');
}
class EventsExtn extends IncludableSpecialPage {
function EventsExtn() {
SpecialPage::SpecialPage( 'Events', '', true, false, 'default', true );
}
... (The rest of the code seems to work properly)
Maybe someone known how to fix this?