Page MenuHomePhabricator

Moving of user subpages ending with JSON content model does not leave redirect regardless if user has "suppress-redirect" right
Closed, InvalidPublic

Description

When I moved a page in my userspace (User:Zaenon/Sandbox.json) to User:Zaenon/sandbox.json, The move did not leave a redirect, despite that I didn't have the "suppress-redirect" right.

This could be reproduced by creating a user subpage ending with .json (this signifies that it will use the JSON content model), then moving it to another user subpage (still with .json). If you go back to the previous page, it will look to be deleted by moving with creating a redirect.

Event Timeline

Was Leave a redirect behind ticked?

It would be impossible for me to actually tick that, as I am not in any user groups that have the suppress-redirect right. I successfully reproduced this bug at test Wikipedia. You can see it in my contributions.

This happens with all pages that do not have the wikitext content model, as only the wikitext content model supports redirects. As the custom content model doesn't support redirects, the redirecting page would have it's content model changed to wikitext. Problem is, that when you do that, turning the content model back would not be possible for regular users, as generally only privileged users have permission to change the content model. This happens with Flow pages as well.

DannyS712 subscribed.

Some content models just don't support redirects. This is the case for json:

  • the ContentHandler class has a function, makeRedirectContent, that returns null if redirects aren't supported. By default, it returns null
  • the JsonContentHandler, extends this class (technically, it extends CodeContentHandler, which extends TextContentHandler, which then extends ContentHandler) but never overrides this function.
  • Thus, when the system goes to create a redirect after you move the page, it can't