Last modified: 2013-10-09 18:03:44 UTC
Currentlym if SomeUser moves its [[User:SomeUser/vector.js]] to [[User:SomeUser/common.js]], the vector page will receive the redirect code such as ---------------------------------------- #REDIRECT [[User:SomeUser/common.js]] ---------------------------------------- which breaks the user scripts since this is not part of JS syntax (see a real case in the provided URL). I think it is good idea to avoid this breakage somehow, e.g.: * Do not redirect the JS and CSS pages when moved * Add the redirect code /* inside of a comment */ (and make it work there, if it currently doesn't) * Add some kind of "importScript" or "mw.loader.load" function instead of a redirect, so that if a user is importing the old page it will still get the content of the script * Some other option...
Created attachment 8863 [details] Proposed fix
Created attachment 8864 [details] Follow up patch Oops, this one trims the newline off the redirect
Commenting it out seems like a weird way of avoiding this bug, besides it leaves an invalid redirect. Either: * Don't allow moving without 'suppress redirect' option of css/js subpages * Change the loader to follow redirects * Change the loader to ignore redirects
(In reply to comment #3) > Commenting it out seems like a weird way of avoiding this bug, besides it > leaves an invalid redirect. > > Either: > * Don't allow moving without 'suppress redirect' option of css/js subpages That no good for people who don't have the suppress redirect right, which are the people who are requesting this. > * Change the loader to follow redirects That sounds like a bad idea that could cause more trouble than it's worth. > * Change the loader to ignore redirects That might be doable, let me try it out.
Created attachment 8866 [details] Alternate method, redirect ignored in resourceloader
Assigning to Roan for review.
Fixed in r94155. Thanks for the patch.
*** Bug 27509 has been marked as a duplicate of this bug. ***