Page MenuHomePhabricator

Visiting Special:SpecialPages while SocialProfile is installed throws a PHP error
Closed, ResolvedPublic

Description

NOTE: Originally reported by someone else, moved upstream from https://www.mediawiki.org/wiki/Extension_talk:SocialProfile#Error_viewing_Special:SpecialPages

Error:

Strict Standards: Declaration of UploadAvatar::performUpload() should be capable with UploadBase::performUpload($comment, $pageText, $watch, $user, $tags = Array) in ...Extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php in line 256

Event Timeline

Well, I changed line 359 to public function performUpload( $comment, $pageText, $watch, $user, $tags = [] ) { and it seemed to work. Then I attempted to upload an avatar and received the following error:

Warning: getimagesize(): Filename cannot be empty in .../extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php on line 364

Fatal error: Call to a member function setSubmitText() on string in .../includes/specials/SpecialUpload.php on line 353

It seems that perhaps the solution would be disabling Strict Standards messages display.

Interesting, to say the very least.

You're right in that performUpload's signature has changed -- I wonder why I haven't spotted this before, I think I should have E_STRICT reporting enabled both locally and on http://social-tools.wmflabs.org/ .

What version of MediaWiki, PHP and SocialProfile are you using? Can you pastebin your wiki's LocalSettings.php with sensitive info (database credentials, $wgSecretKey/$wgProxyKey, etc.) removed?

The aforementioned test wiki runs on MediaWiki 1.28 and the latest (git master) version of SocialProfile (as well as several other social tools, but that's besides the point). The only combination I'm able to support is the latest stable version of MediaWiki (currently 1.28) and latest version (git master or close to it) of SocialProfile. You should always be using latest versions (i.e. master) of the social tools with the latest stable release of MediaWiki to ensure maximum compatibility, security and performance.

Following this ticket, I tested this out on http://social-tools.wmflabs.org/ , and as you can see on the avatar log, uploading an avatar worked out just fine and Special:SpecialPages isn't throwing out any errors or displaying a white screen of death either. (You can test it out, too, but please let me know your username if you sign up for a test account, because avatar uploading and other write actions on that test wiki are restricted to users in the confirmed group -- this is a cheap anti-spam measure.)

We have a git repository here. I'm currently checking if the extension is up to date.

It does not appear to be up to date with the master branch. I will try updating.

Change 330053 had a related patch set uploaded (by Jack Phoenix):
Make the signature of UploadAvatar::performUpload() consistent with UploadBase::performUpload() to get rid of an E_STRICT notice

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

Change 330053 merged by jenkins-bot:
Make the signature of UploadAvatar::performUpload() consistent with UploadBase::performUpload() to get rid of an E_STRICT notice

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

SamanthaNguyen assigned this task to ashley.
SamanthaNguyen removed a project: Patch-For-Review.