Topic on Project:Support desk

Help With Deprecated Method getCanonicalName()

3
Z929669 (talkcontribs)

I want to upgrade to the latest LTS release 1.39.1 from 1.35.1, but I'm blocked by this method deprecated as of 1.38. Unfortunately, the 1.38 release notes do not allude to alternative methods for those deprecated.

The problem is that this method is used by Extension:IPBAuthLogin, and I want to try to figure out if it's possible to wrangle it into submission. I'm not a PHP coder, but I can usually figure things out or at least learn enough to ask the right questions.

I operate a closed wiki restricted to forum members only, so my forums act as a gateway to User access to the wiki. This method is a part of a function that essentially normalizes a wiki and forum user name to get a clean match without possibility of duplicating users, allowing authentication with my forum user names.

Here's the trace for the error:

[1bb5c341ca3ff5879eb19ed7] /wiki/index.php?title=Special:UserLogin&returnto=Special:Version Error: Call to undefined method User::getCanonicalName()
Backtrace:
from /srv/sites/_wiki/extensions/IPBAuthLogin/includes/IPBAuth.php(136)
#0 /srv/sites/_wiki/extensions/IPBAuthLogin/includes/auth/IPBAuthenticationProvider.php(185): IPBLoginAuth\IPBAuth::normalizeUsername()
#1 /srv/sites/_wiki/includes/auth/AuthManager.php(922): IPBLoginAuth\Auth\IPBAuthenticationProvider->providerNormalizeUsername()
#2 /srv/sites/_wiki/includes/auth/ThrottlePreAuthenticationProvider.php(137): MediaWiki\Auth\AuthManager->normalizeUsername()
#3 /srv/sites/_wiki/includes/auth/AuthManager.php(425): MediaWiki\Auth\ThrottlePreAuthenticationProvider->testForAuthentication()
#4 /srv/sites/_wiki/includes/specialpage/AuthManagerSpecialPage.php(372): MediaWiki\Auth\AuthManager->beginAuthentication()
#5 /srv/sites/_wiki/includes/specialpage/AuthManagerSpecialPage.php(502): AuthManagerSpecialPage->performAuthenticationStep()
#6 /srv/sites/_wiki/includes/htmlform/HTMLForm.php(725): AuthManagerSpecialPage->handleFormSubmit()
#7 /srv/sites/_wiki/includes/specialpage/AuthManagerSpecialPage.php(435): HTMLForm->trySubmit()
#8 /srv/sites/_wiki/includes/specialpage/LoginSignupSpecialPage.php(320): AuthManagerSpecialPage->trySubmit()
#9 /srv/sites/_wiki/includes/specialpage/SpecialPage.php(701): LoginSignupSpecialPage->execute()
#10 /srv/sites/_wiki/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run()
#11 /srv/sites/_wiki/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#12 /srv/sites/_wiki/includes/MediaWiki.php(904): MediaWiki->performRequest()
#13 /srv/sites/_wiki/includes/MediaWiki.php(562): MediaWiki->main()
#14 /srv/sites/_wiki/index.php(50): MediaWiki->run()
#15 /srv/sites/_wiki/index.php(46): wfIndexMain()
#16 {main}

Any help would be appreciated, and if it's an easy patch, I can handle it. I'll even fork the extension and host. If not, I will need a PHP developer to help out.

Ammarpad (talkcontribs)
Z929669 (talkcontribs)

I was able to work through updates to my local of Extension:IPBAuthLogin with that method as a starting point, so thank you again!

Once I'm finished with all my testing, I will fork and update it.

Is it best practice to update the extension in place (will likely render it useless for MW versions < 1.38), or should that one be left "as is" for compatibility with 1.35-1.37?

Reply to "Help With Deprecated Method getCanonicalName()"