Menu

#162 Page moves should not suppress redirects by default

closed
None
5
2008-11-13
2008-11-10
Anonymous
No

When moving pages with Page.move(), a redirect should be created by default. Users with the 'suppressredirect' right (e.g. bots on Wikimedia projects) should be able to suppress redirects. I propose adding a parameter leaveRedirect=True (or possibly suppresRedirect=False) to the function.

Discussion

  • Multichill

    Multichill - 2008-11-13

    In svn revision 6084 i implemented leaveRedirect. By default this is true.

    def move(self, newtitle, reason=None, movetalkpage=True, sysop=False,
    - throttle=True, deleteAndMove=False, safe=True, fixredirects=True):
    + throttle=True, deleteAndMove=False, safe=True, fixredirects=True, leaveRedirect=True):
    """Move this page to new title given by newtitle. If safe, don't try
    to move and delete if not directly requested.

    @@ -2226,6 +2226,10 @@
    predata['wpFixRedirects'] = '1'
    else:
    predata['wpFixRedirects'] = '0'
    + if leaveRedirect:
    + predata['wpLeaveRedirect'] = '1'
    + else:
    + predata['wpLeaveRedirect'] = '0'
    if token:

     
  • Multichill

    Multichill - 2008-11-13
    • assigned_to: nobody --> multichill
    • status: open --> closed
     
  • Yann Forget

    Yann Forget - 2008-11-25

    Thanks to Andre Engels who helped for this, please add to movepages.py:

    86c86
    < def __init__(self, generator, addprefix, delete, always, skipredirects, summary, leaveRedirect):
    ---
    > def __init__(self, generator, addprefix, delete, always, skipredirects, summary):
    93d92
    < self.leaveRedirect = leaveRedirect
    101c100
    < if page.move(newPageTitle, msg, throttle=True, leaveRedirect=self.leaveRedirect) and self.delete:
    ---
    > if page.move(newPageTitle, msg, throttle=True) and self.delete:
    223d221
    < leaveRedirect = True
    249,250d246
    < elif arg == '-noredirect':
    < leaveRedirect = False
    284c280
    < bot = MovePagesBot(None, prefix, delete, always, skipredirects, summary, leaveRedirect)
    ---
    > bot = MovePagesBot(None, prefix, delete, always, skipredirects, summary)
    288c284
    < bot = MovePagesBot(preloadingGen, prefix, delete, always, skipredirects, summary, leaveRedirect)
    ---
    > bot = MovePagesBot(preloadingGen, prefix, delete, always, skipredirects, summary)

     

Log in to post a comment.