Page MenuHomePhabricator

Message key "user-fanbox-title" used twice: SocialProfile and FanBoxes
Closed, ResolvedPublic

Description

The message key "user-fanbox-title" is used twice: in SocialProfile and FanBoxes: https://codesearch.wmcloud.org/search/?q=user-fanbox-title&i=nope&files=en&excludeFiles=&repos=

Therefore translatewiki has a duplicate key.

I tried to replace one of the keys with a unique one but I could not find any usage of the message key in the program code itself. Maybe both are unused?

Event Timeline

Hi Raymond, thanks for reporting this!

The user-fanbox-title message is used as the section title on social user profile pages (of course hilariously enough that old screenshot does not, in fact, show off *that* particular section...).
The key in question is used by /extensions/SocialProfile/UserProfile/includes/UserProfilePage.php, line 1883, function getFanBoxes. That said, the code in that method is active only when both $wgEnableUserBoxes and $wgUserProfileDisplay['userboxes'] are set to true. It is assumed (though badly documented!) that a knowledgeable sysadmin will set those globals to true once they've installed the FanBoxes extension; without that, setting the globals on would probably throw PHP fatals about undefined classes like UserFanBoxes (line 1849).

Therefore I suggest we remove the duplicate key from SocialProfile's i18n files as the code in question cannot run without FanBoxes (though I *do* agree that the FanBoxes-specific code should indeed _fully_ live in /extensions/FanBoxes and use hooks etc. properly instead). Does that sound acceptable?

Therefore I suggest we remove the duplicate key from SocialProfile's i18n files as the code in question cannot run without FanBoxes (though I *do* agree that the FanBoxes-specific code should indeed _fully_ live in /extensions/FanBoxes and use hooks etc. properly instead). Does that sound acceptable?

Yes, sounds good.

Change 665307 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/extensions/SocialProfile@master] Remove duplicate "user-fanbox-title" message key, already defined in the FanBoxes extension

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

Change 665307 merged by jenkins-bot:
[mediawiki/extensions/SocialProfile@master] Remove duplicate "user-fanbox-title" message key, already defined in the FanBoxes extension

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

ashley claimed this task.
ashley removed a project: Patch-For-Review.