Topic on Extension talk:AddPersonalUrls

override of $wgAddPersonalUrlsTable not as expected

3
AnonymusGdpr (talkcontribs)

Hi there ...

I want to override the settings by

wfLoadExtension( 'AddPersonalUrls' );
$wgAddPersonalUrlsTable = array(
        'addpersonalurls-userpages' => 'Special:PrefixIndex?prefix=$username&namespace=2',
        'addpersonalurls-favorites' => 'Special:Mypage/Favoriten',
        'addpersonalurls-sandbox' => 'Special:Mypage/Spielwiese',
        'addpersonalurls-notes' => 'Special:Mypage/Notizen'
);

but the "Home" link is still being shown.

RV1971 (talkcontribs)

This is because $wgAddPersonalUrlsTable does not replace the settings in extension.json but is merged into them. This is the normal way configuration works now in MediaWiki. I just corrected the extension documentation which was outdated in this regard.

Thanks for attracting my attention to the fact that this requires a mechanism to deactivate predefined items. To solve this, I have just created version 1.2.1 (and merged it into the branches for MW 1.30, 1.31 and 1.32). With this, you can override as follows:

wfLoadExtension( 'AddPersonalUrls' );
$wgAddPersonalUrlsTable = array(
        'addpersonalurls-home' => NULL,
        'addpersonalurls-userpages' => 'Special:PrefixIndex?prefix=$username&namespace=2',
        'addpersonalurls-favorites' => 'Special:Mypage/Favoriten',
        'addpersonalurls-sandbox' => 'Special:Mypage/Spielwiese',
        'addpersonalurls-notes' => 'Special:Mypage/Notizen'
);
AnonymusGdpr (talkcontribs)

Hi RV1971! That fits perfectly well ...! Thanks a lot & happy Christmas, A.

Reply to "override of $wgAddPersonalUrlsTable not as expected"