Page MenuHomePhabricator

Conflict between UserMerge and GoogleLogin
Closed, ResolvedPublic

Description

Hello,

Since I'm using GoogleLogin extension, UserMerge gives me the following error :

[WVuY-lOmig0AAvIYWckAAAAW] /dico/Sp%C3%A9cial:Fusionner_les_utilisateurs Error from line 55 of /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/GoogleLogin/includes/GoogleLogin.hooks.php: Call to undefined method User::hasConnectedGoogleAccount()
Backtrace:
#0 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/Hooks.php(195): GoogleLogin\GoogleLoginHooks::onMergeAccountFromTo(User, User)
#1 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/UserMerge/MergeUser.php(289): Hooks::run(string, array)
#2 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/UserMerge/MergeUser.php(46): MergeUser->mergeDatabaseTables()
#3 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/UserMerge/SpecialUserMerge.php(136): MergeUser->merge(User)
#4 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/htmlform/HTMLForm.php(656): SpecialUserMerge->onSubmit(array, HTMLForm)
#5 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/htmlform/HTMLForm.php(553): HTMLForm->trySubmit()
#6 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/htmlform/HTMLForm.php(568): HTMLForm->tryAuthorizedSubmit()
#7 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/FormSpecialPage.php(155): HTMLForm->show()
#8 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/SpecialPage.php(522): FormSpecialPage->execute(NULL)
#9 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/SpecialPageFactory.php(577): SpecialPage->run(NULL)
#10 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/MediaWiki.php(283): SpecialPageFactory::executePath(Title, RequestContext)
#11 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/MediaWiki.php(851): MediaWiki->performRequest()
#12 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/MediaWiki.php(512): MediaWiki->main()
#13 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/index.php(43): MediaWiki->run()
#14 {main}

Any workaround ?

Thanks !

/DSwissK

Event Timeline

DSwissK created this task.Jul 4 2017, 1:51 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 4 2017, 1:51 PM

Forgot to add the versions :

MediaWiki 1.28.2
UserMerge 1.10.0 (31ea86d)
GoogleLogin 0.4.0 (d7127e6)

Florian claimed this task.EditedJul 5 2017, 3:54 PM

I already recognized this and proposed a change:
https://gerrit.wikimedia.org/r/#/c/362874/

@DSwissK Could you probably test this change and give a feedback, if that solves the problem?

Change 362874 had a related patch set uploaded (by Florianschmidtwelzow; owner: Florianschmidtwelzow):
[mediawiki/extensions/GoogleLogin@master] GoogleUser::hasConnectedGoogleAccount should be called statically

https://gerrit.wikimedia.org/r/362874

Change 362874 merged by jenkins-bot:
[mediawiki/extensions/GoogleLogin@master] GoogleUser::hasConnectedGoogleAccount should be called statically

https://gerrit.wikimedia.org/r/362874

DSwissK added a comment.EditedJul 7 2017, 6:43 PM

I already recognized this and proposed a change:
https://gerrit.wikimedia.org/r/#/c/362874/
@DSwissK Could you probably test this change and give a feedback, if that solves the problem?

@Florian Thanks, I tried your change and the merging part worked perfectly. :)

@Florian

Nevermind, I spoke too fast. Now Google Login isn't working :

[WV-WjlOmig0AAEcyVAUAAAAL] /wiki/index.php?title=Sp%C3%A9cial:Connexion&returnto=Dico:Accueil Error from line 27 of /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/GoogleLogin/includes/GoogleLogin.body.php: Class 'Google_Client' not found
Backtrace:
#0 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/GoogleLogin/includes/auth/GooglePrimaryAuthenticationProvider.php(323): GoogleLogin\GoogleLogin::getClient(string, string)
#1 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/GoogleLogin/includes/auth/GooglePrimaryAuthenticationProvider.php(307): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->getGoogleClient()
#2 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/GoogleLogin/includes/auth/GooglePrimaryAuthenticationProvider.php(40): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->beginGoogleAuthentication(array, string)
#3 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/auth/AuthManager.php(451): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->beginPrimaryAuthentication(array)
#4 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/auth/AuthManager.php(381): MediaWiki\Auth\AuthManager->continueAuthentication(array)
#5 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/AuthManagerSpecialPage.php(355): MediaWiki\Auth\AuthManager->beginAuthentication(array, string)
#6 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/AuthManagerSpecialPage.php(484): AuthManagerSpecialPage->performAuthenticationStep(string, array)
#7 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/htmlform/HTMLForm.php(656): AuthManagerSpecialPage->handleFormSubmit(array, VFormHTMLForm)
#8 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/AuthManagerSpecialPage.php(418): HTMLForm->trySubmit()
#9 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/LoginSignupSpecialPage.php(305): AuthManagerSpecialPage->trySubmit()
#10 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/SpecialPage.php(522): LoginSignupSpecialPage->execute(NULL)
#11 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/SpecialPageFactory.php(577): SpecialPage->run(NULL)
#12 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/MediaWiki.php(283): SpecialPageFactory::executePath(Title, RequestContext)
#13 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/MediaWiki.php(851): MediaWiki->performRequest()
#14 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/MediaWiki.php(512): MediaWiki->main()
#15 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/index.php(43): MediaWiki->run()
#16 {main}

I reverted GoogleLogin extension back to the working version

Reedy added a comment.Jul 7 2017, 6:50 PM

Have you run composer to get the google/apiclient?

@Reedy No, I downloaded the full archive. I don't know how to use composer for patching an extension (I only used it to intall a working version). Shall I just copy that ?

git pull https://gerrit.wikimedia.org/r/mediawiki/extensions/GoogleLogin refs/changes/74/362874/3

@DSwissK: If you normally use the ExtensionDistributor, the composer dependencies are included there. If you use git do get the copy of GoogleLogin, you need to download the dependencies manually by running composer update in the directory (you need to install composer beforehand). However, the change was already merged (thanks @Umherirrender), so you now can simply download a new copy from the ExtensionDistributor, the change should already be included in the latest master version (be sure to select "master").

I'll close this task as resolved, however, if you find that it does not work in your test, feel free to comment and/or reopen the task :) Thanks for filing the bug and for your support! :)

Florian closed this task as Resolved.Jul 7 2017, 8:50 PM
DSwissK reopened this task as Open.Jul 8 2017, 10:39 AM

Hi again @Florian

First of all, thank YOU for your support! Sorry to reopen this. I'm not sure my query does belong here but I wasted 2 hours trying to get ExtensionDistributor working to be able to GoogleLogin master version.

The code for Wikimedia's Gerrit instance given in https://www.mediawiki.org/wiki/Extension:ExtensionDistributor doesn't seem to work.

Do you mind giving me your LocalSettings bit of code to make it work ?

Here was my last attempt :

$wgExtDistAPIConfig = array(
	'class' => 'GerritExtDistProvider',
        'apiUrl' => 'https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki%2F$TYPE%2F$EXT,branches',
	'tarballUrl' => 'https://extdist.wmflabs.org/dist/$TYPE/$EXT-$REF-$SHA.tar.gz',
	'tarballName' => '$EXT-$REF-$SHA.tar.gz',
	'repoListUrl' => 'https://gerrit.wikimedia.org/r/projects/?p=mediawiki/$TYPE/',
);

You can download from https://www.mediawiki.org/wiki/Special:ExtensionDistributor/GoogleLogin
no need to install the extension on your own machine

Aklapper closed this task as Resolved.Jul 8 2017, 11:49 AM

Closing as resolved again as the underlying issue in the code seems to be resolved (Handling extension distributor feels out of scope for this very task.)

DSwissK reopened this task as Open.Jul 8 2017, 12:39 PM

@Umherirrender thank you for your nice and fast answer.

Back to "scope" for this very task. @Florian Now that I've got master version up and running, I get this error message when trying to log in from a google account :

[WWDOc1Omig0AAJFpArsAAAAP] /wiki/index.php?title=Sp%C3%A9cial:Connexion&returnto=Dico%3AAccueil Error from line 63 of /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/GoogleLogin/vendor/google/apiclient-services/src/Google/Service/Plus.php: Class 'Google_Service_Plus_Resource_Activities' not found
Backtrace:
#0 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/GoogleLogin/includes/auth/GooglePrimaryAuthenticationProvider.php(352): Google_Service_Plus->__construct(Google_Client)
#1 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/extensions/GoogleLogin/includes/auth/GooglePrimaryAuthenticationProvider.php(51): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->getAuthenticatedGooglePlusFromRequest(GoogleLogin\Auth\GoogleServerAuthenticationRequest)
#2 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/auth/AuthManager.php(518): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->continuePrimaryAuthentication(array)
#3 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/AuthManagerSpecialPage.php(357): MediaWiki\Auth\AuthManager->continueAuthentication(array)
#4 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/AuthManagerSpecialPage.php(484): AuthManagerSpecialPage->performAuthenticationStep(string, array)
#5 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/htmlform/HTMLForm.php(656): AuthManagerSpecialPage->handleFormSubmit(array, VFormHTMLForm)
#6 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/AuthManagerSpecialPage.php(418): HTMLForm->trySubmit()
#7 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/LoginSignupSpecialPage.php(305): AuthManagerSpecialPage->trySubmit()
#8 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/SpecialPage.php(522): LoginSignupSpecialPage->execute(NULL)
#9 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/specialpage/SpecialPageFactory.php(577): SpecialPage->run(NULL)
#10 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/MediaWiki.php(283): SpecialPageFactory::executePath(Title, RequestContext)
#11 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/MediaWiki.php(851): MediaWiki->performRequest()
#12 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/includes/MediaWiki.php(512): MediaWiki->main()
#13 /home/clients/0486a60c95a26f96e318d8715f689dd7/web/wiki/index.php(43): MediaWiki->run()
#14 {main}

PS : as strange as it sounds, Special:Version tells me that 0.4.0-git (d7127e6 version) is installed. But I unziped 5807545 version in the /extensions/ folder.

Hi, have you really downloaded the master version? It should be 5807545: https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=GoogleLogin&extdistversion=master and the class, which is reported to dow nog exist, exist in this version.

Hi, I have downloaded it again following your link and reinstalled completely but it still says d7127e6 ?! https://dicoado.ch/dico/Special:Version

The version is correct, note, that Special:Version caches the git nformation for some time, to avoid unnecessary file system lookups. So, it should work now. If not, make sure that you really copied all files to the server.

DSwissK closed this task as Resolved.Jul 9 2017, 12:21 PM

True, everything works! Thanks again. :)