Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when not logged in in v1.41 #27

Open
berianwilliams opened this issue Jun 1, 2024 · 3 comments
Open

Error when not logged in in v1.41 #27

berianwilliams opened this issue Jun 1, 2024 · 3 comments

Comments

@berianwilliams
Copy link

berianwilliams commented Jun 1, 2024

Description

In v1.4.1 they changed the function signature of TemporaryPasswordPrimaryAuthenticationProvider (1.40 vs 1.41), which results in the following error:

Original exception: [55272281e6a09665700b0a41] /wiki/Main_Page/history TypeError: MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::__construct(): Argument #1 ($dbProvider) must be of type Wikimedia\Rdbms\IConnectionProvider, Wikimedia\Rdbms\LoadBalancer given, called in /var/www/html/w/extensions/ForumSsoProvider/ForumAuthManager.php on line 36
Backtrace:
from /var/www/html/w/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php(74)
#0 /var/www/html/w/extensions/ForumSsoProvider/ForumAuthManager.php(36): MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider->__construct(Wikimedia\Rdbms\LoadBalancer, MediaWiki\User\UserOptionsManager, array)
#1 /var/www/html/w/vendor/wikimedia/object-factory/src/ObjectFactory.php(240): ForumAuthManager->__construct()
#2 /var/www/html/w/vendor/wikimedia/object-factory/src/ObjectFactory.php(149): Wikimedia\ObjectFactory\ObjectFactory::getObjectFromSpec(array, array)
#3 /var/www/html/w/includes/auth/AuthManager.php(2496): Wikimedia\ObjectFactory\ObjectFactory->createObject(array, array)
#4 /var/www/html/w/includes/auth/AuthManager.php(2541): MediaWiki\Auth\AuthManager->providerArrayFromSpecs(string, array)
#5 /var/www/html/w/includes/auth/AuthManager.php(1051): MediaWiki\Auth\AuthManager->getPrimaryAuthenticationProviders()
#6 /var/www/html/w/includes/skins/SkinTemplate.php(535): MediaWiki\Auth\AuthManager->canCreateAccounts()
#7 /var/www/html/w/includes/skins/SkinTemplate.php(501): SkinTemplate->useCombinedLoginLink()
#8 /var/www/html/w/includes/skins/SkinTemplate.php(1035): SkinTemplate->buildPersonalUrls(boolean)
#9 /var/www/html/w/includes/skins/SkinTemplate.php(604): SkinTemplate->buildContentNavigationUrlsInternal()
#10 /var/www/html/w/includes/skins/SkinTemplate.php(181): SkinTemplate->getPortletsTemplateData()
#11 /var/www/html/w/includes/skins/SkinMustache.php(125): SkinTemplate->getTemplateData()
#12 /var/www/html/w/skins/Vector/includes/SkinVectorLegacy.php(161): SkinMustache->getTemplateData()
#13 /var/www/html/w/includes/skins/SkinMustache.php(92): MediaWiki\Skins\Vector\SkinVectorLegacy->getTemplateData()
#14 /var/www/html/w/includes/skins/SkinTemplate.php(174): SkinMustache->generateHTML()
#15 /var/www/html/w/includes/Output/OutputPage.php(2947): SkinTemplate->outputPage()
#16 /var/www/html/w/includes/MediaWiki.php(978): MediaWiki\Output\OutputPage->output(boolean)
#17 /var/www/html/w/includes/MediaWiki.php(613): MediaWiki->main()
#18 /var/www/html/w/index.php(50): MediaWiki->run()
#19 /var/www/html/w/index.php(46): wfIndexMain()
#20 {main}

This only seems to occur if you aren't logged into SMF, looks like it works fine when you're already logged in.

@jdarwood007 I don't know MediaWiki well enough to fix it myself, but it'd be great if you could please take a look?

Steps to reproduce

  1. Upgrade to MediaWiki >= v1.41.
  2. Install latest smf-mw-auth extension from master.
  3. Log out of SMF.
  4. Hit any page on the wiki; I tried /wiki/Main_Page/history.

Environment (complete as necessary)

  • Version/Git revision: master
  • Database Type: MySQL
  • Database Version: 8.3.0
  • PHP Version: 8.3

Additional information/references

berianwilliams added a commit to berianwilliams/smf-mw-auth that referenced this issue Jun 4, 2024
Addressing SimpleMachines#27 by updating constructor in TemporaryPasswordPrimaryAuthenticationProvider to use getDBLoadBalancerFactory.
@berianwilliams
Copy link
Author

Turned out to be a really simple fix, and seems to work with and without logging in again!

@jdarwood007
Copy link
Member

You are welcome to submit that as a PR against master. I branched the code so it can be updated to support 1.43 in the future, but haven't had time to look at the changes in 1.40, 1.41 and the upcoming changes in 1.42

@berianwilliams
Copy link
Author

You are welcome to submit that as a PR against master. I branched the code so it can be updated to support 1.43 in the future, but haven't had time to look at the changes in 1.40, 1.41 and the upcoming changes in 1.42

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants