Page MenuHomePhabricator

Special:TopFansByStatistic doesn’t work with PHP 7.3
Closed, ResolvedPublic

Description

PHP: 7.3.6
MediaWiki 1.33.0
SocialProfile: latest commit on master branch


Special:TopFansByStatistic throws an error in PHP 7.3

[766a0c7191d77eeb17f45d8a] /index.php?title=Special:TopFansByStatistic&stat=gifts_sent_count Error from line 184 of /var/www/html/extensions/SocialProfile/UserStats/includes/specials/TopFansByStat.php: Call to undefined method LanguageEn::truncate()

Backtrace:

#0 /var/www/html/includes/specialpage/SpecialPage.php(569): TopFansByStat->execute(NULL)
#1 /var/www/html/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#2 /var/www/html/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#3 /var/www/html/includes/MediaWiki.php(865): MediaWiki->performRequest()
#4 /var/www/html/includes/MediaWiki.php(515): MediaWiki->main()
#5 /var/www/html/index.php(42): MediaWiki->run()
#6 {main}


To Reproduce:
Install MediaWiki 1.33 and latest master commit of SocialProfile with PHP 7.3

Go to special:TopFansByStatistic&stat=gifts_sent_count (or any other stat)

Error is thrown.

Event Timeline

Change 521971 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/extensions/SocialProfile@master] Language#truncate no longer exists in core in MW 1.33+, use truncateForVisual() instead

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

Change 521971 merged by jenkins-bot:
[mediawiki/extensions/SocialProfile@master] Language#truncate no longer exists in core in MW 1.33+, use truncateForVisual() instead

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

ashley claimed this task.
ashley subscribed.

Thanks for the report, fixed in git master!

(Actually this wasn't a PHP 7.3+ issue but rather "just" a simple bug -- the SocialProfile special page attempting to use a method that was removed from MW core for the 1.33 release; it was present, though deprecated, in 1.32 and older, hence why this wasn't spotted previously.)