Page MenuHomePhabricator

SocialProfile needs to be ported to ResourceLoader
Closed, ResolvedPublic

Description

Current trunk version of SocialProfile has been tested and developed against MediaWiki 1.16 and it seems that it will work only on 1.16 at the moment; it appears quite broken on current trunk version of MediaWiki (1.19alpha).

I've tried porting SocialProfile to use ResourceLoader a few times now and the JS is always giving me a headache. I've rewritten SocialProfile/UserGifts/UserGifts.js to be more object-oriented, but the way its functions are (currently) used seems to be problematic when combined with the ResourceLoader; see SocialProfile/UserGifts/SpecialGiveGift.php, lines 244, 313 and 372.

I'd like to retain backwards compatibility with MediaWiki 1.16 for the time being, as I need to deploy SocialProfile on some ShoutWiki sites, which still run 1.16.

SystemGifts, UserActivity, UserStats and UserWelcome have only CSS files; UserSystemMessages has no CSS nor JS and the remaining "modules" (UserBoard, UserGifts, UserProfile, UserRelationship and UserStatus) have both CSS and JS files.

Assigning to Krinkle as per Reedy's suggestion on MediaWiki-General:

08:02 < ashley> to whom might I assign a ResourceLoader-related bug? specifically, my SocialProfile extension appears to be rather...broken in current trunk (and probably for 1.17+ in general) and it needs to be ported to use RL (retaining backwards compat w/ 1.16) but jQuery and RL are driving me crazy :-/
08:02 < Reedy> ashley, Roan, Trevor or maybe Krinkle


Version: unspecified
Severity: enhancement
URL: http://www.mediawiki.org/wiki/Extension:SocialProfile/Roadmap

Details

Reference
bz29984

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:36 PM
bzimport added a project: SocialProfile.
bzimport set Reference to bz29984.
bzimport added a subscriber: Unknown Object (MLST).

This would improve RTL support for SocialProfile.
If JS is a problem, maybe it can be done only for CSS, temporarily?

From what I've understood, porting SocialProfile to ResourceLoader before ResourceLoader 2/MediaWiki 1.19 will be quite difficult, if not impossible, because of the way how SocialProfile uses inline JS in certain places.
According to http://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_for_extension_developers#Inline_JavaScript, MW 1.19 will ship with RL2, which has the top-load queue; by loading JS in the top (just like how we've done it until RL/MW 1.17), we can avoid rewriting lots and lots of code.

As for porting CSS only for the time being...I have to say that I'm not a big fan of the idea. I'd much rather have this issue fixed properly for once and for all; sure, we /can/ port CSS to use RL right away, but the fact is that JS will still be broken.

daniel wrote:

i'm user of socialprofile, and the js is debugging, i think if socialprofile supported the newest releases of mediawiki will make my life easier, in version 1.17.0 i cant run socialprofile because have js errors and loss of functionality (i can't send board messages), :((

Marking this as high as per my discussion with Mark on MediaWiki-General today; there's major loss of functionality (pretty much everything that uses JS doesn't work, i.e. sending board messages, as mentioned by Daniel above, picking a friend from the list on Special:GiveGift, etc. etc.) and users have every right to assume that latest trunk version of an extension is compatible with the latest stable release of MediaWiki.
Unfortunately for SocialProfile, that is right now not true and users wanting to use SocialProfile are forced to use the old 1.16 branch of MediaWiki.

Resetting assignee. I don't know the extension and currently have a agenda packed with other projects. I'm happy to give some general advice on IRC but no time to go the actual porting.

I've (mostly) done this in gerrit changeset #79830 so I'm closing this ticket.