Page MenuHomePhabricator

Special:ContentTranslationStats and Special:ContentTranslation have no sidebar in page HTML
Closed, DeclinedPublic

Description

Special:ContentTranslationStats and Special:ContentTranslation have no sidebar in page HTML. This breaks built-in MediaWiki functions like mw.util.addPortletLink, and causes that page not to load for me on pl.wikipedia when I'm logged in because of a trivial gadget (https://pl.wikipedia.org/wiki/MediaWiki:Gadget-revisiondelete.js). This effectively means that users of such gadgets can not use Content Translation.

pasted_file (1×1 px, 82 KB)

Event Timeline

matmarex raised the priority of this task from to Needs Triage.
matmarex updated the task description. (Show Details)
matmarex added a project: ContentTranslation.
matmarex subscribed.
matmarex renamed this task from Special:ContentTranslationStats has no sidebar to Special:ContentTranslationStats and Special:ContentTranslation have no sidebar.Jan 30 2016, 3:03 PM
matmarex updated the task description. (Show Details)
matmarex set Security to None.

This effectively means that users of certain gadgets can not use Content Translation, because the sidebar-less special page explodes. That's pretty bad.

This breaks built-in MediaWiki functions like mw.util.addPortletLink

mw.util.addPortletLink is written defensively to avoid page issues when sidebar not present.

Not having sidebar for CX was a design decision taken considering the need to present source article and target article in same page, and validated by user testing. So I don't think we revert that decision. But we had found some gadgets, especially gadgets using native getElementById and accessing the elements without checking for null/undefined breaking CX. We contacted the gadget authors and fixed it in such cases.

In the case of https://pl.wikipedia.org/wiki/MediaWiki:Gadget-revisiondelete.js, even though the documentation of mw.util.addPortletLink says return value can be null, the gadget is not checking against null.

Right, I'm not here to question your design decisions (although I disagree with this particular one :) ), I'm just talking about how this was implemented. Special pages are not supposed to take over rendering the skin HTML from the skin.

mw.util.addPortletLink is underdocumented, but I think null is not an "expected" return value – basically, it normally only returns null when it was called with incorrect parameters. mw.util.addPortletLink should work on all pages using the Vector skin, ContentTranslation breaks this expectation.

I think you should be hiding the sidebar with CSS, and not removing it from the skin HTML. If gadgets work on every other page of the wiki, except for the ones generated by ContentTranslation, it might be a sign that ContentTranslation does something unexpected.

Amire80 claimed this task.
Amire80 subscribed.

Sorry, I have to decline this.

As @santhosh writes, this was a design decision, there were good reasons for it, and it won't be reverted. I acknowledge that it works against the usual logic of desktop skins and gadgets and that it causes occasional issues, but these issues are in the gadgets themselves and in how MediaWiki runs them rather than in this particular extension. Gadgets can break many other things for many other reasons. We tested the extension in every wiki in which we deployed it, and worked with the communities to fix the issues, and it was successful.

I think you missed my last comment. But if not, I can only say that I'm sad you're not striving to make your software great :(

matmarex renamed this task from Special:ContentTranslationStats and Special:ContentTranslation have no sidebar to Special:ContentTranslationStats and Special:ContentTranslation have no sidebar in page HTML.Feb 2 2016, 7:08 PM
matmarex updated the task description. (Show Details)