Page MenuHomePhabricator

Support redirects in JavaScriptContent
Closed, ResolvedPublic

Description

During the Gadgets 2.0 migration, we will be moving a lot of JS pages around. In order not to break existing mw.loader.load calls to MediaWiki:Gadget- pages, we should support redirects for JS pages.


Version: unspecified
Severity: enhancement
See Also: T73201

Details

Reference
bz71200

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:50 AM
bzimport set Reference to bz71200.
bzimport added a subscriber: Unknown Object (MLST).

This looks like a dupe of bug 33973 to me.

gerritadmin wrote:

Change 162491 had a related patch set uploaded by Legoktm:
Support redirects in JavaScriptContent

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

Current patch only creates "redirects" behind, but MW doesn't actually recognize these as redirects. This means people without "delete" can't revert moves (if they move their own common.js or something) since the pages aren't recognized as redirects.

Also if a wiki changes their domain, there is no easy way to find "redirects" that need updating without doing a full text search (usually difficult) or just going through logs (not perfect).

My proposal is that we make these real MW redirects.

We can't just turn any mw.loader.load("url...") into a redirect since people might have common.js's with just one script being loaded.

A magic syntax like /* #REDIRECT */mw.loader.load("url..."); is what I'm thinking of. "#REDIRECT" will be hardcoded and English only and must be in that exact format with spaces and whatnot.

Thoughts?

Change 162491 had a related patch set uploaded by Legoktm:
Support redirects in JavaScriptContent

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

Was merged: rMWad9f14d662f9: Support redirects in JavaScriptContent.

Legoktm set Security to None.

Does this supposed to work?
https://pl.wikipedia.org/wiki/Wikipedysta:Nux/nuxTBKeys.js

Code:
/* #REDIRECT */mw.loader.load("MediaWiki:Gadget-nuxTBKeys.js");

I'm trying to redirect to https://pl.wikipedia.org/wiki/MediaWiki:Gadget-nuxTBKeys.js

In T73200#1489424, @Nux wrote:

Does this supposed to work?
https://pl.wikipedia.org/wiki/Wikipedysta:Nux/nuxTBKeys.js

Code:
/* #REDIRECT */mw.loader.load("MediaWiki:Gadget-nuxTBKeys.js");

It needs to be an absolute url with the full domain and query parameters...it really wasn't meant to be created directly, just during page moves.