Page MenuHomePhabricator

Treat code-only interwikis as valid for main page
Open, LowPublic

Description

Interwiki in the form of [[en:]] links to the main page.

It is easy to generate (on Toolserver or from SiteMatrix) a list of interwikis in this form for the main page and they are correct links.

So the bot must not remove them nor change them.

Suggesting the following process:

  1. Pull MediaWiki:Mainpage and store it in some variable.
  2. When dealing with interwiki, first compare, if the page title == that variable.
  3. If yes, simply put short interwikis there (or at least do not remove nor correct them to long)

Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1344/
Reported by: Anonymous user
Created on: 2011-09-19 11:07:11
Subject: Treat code-only interwikis as valid for main page

Details

Reference
bz55235

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:28 AM
bzimport set Reference to bz55235.
bzimport added a subscriber: Unknown Object (????).

r9672 enables short interwiki links but replaces the page title to the MediaWiki:Mainpage message

  • assigned_to: nobody --> xqt

Is this useful? Most mainpages are protected aren't they? Why don't we just have the bot ignore/skip mainpages altogether?

I guess it is usefull if the bot can handle with links like \[\[:en:\]\] rather than giving an error. It is able to create a page objekt. And this could be used indepedent from operating on the main page itself.

With at least https://git.wikimedia.org/commit/pywikibot%2Fcore.git/71ccd1267c2407fc3fea1210c5f442edb7f6d9c3 Link.parse supports interwiki links without any title (so [[en:]] for example). So the bot ifself should substitute '' with the mainpage. I previously wanted to add it but John pointed out that it's problematic:

https://gerrit.wikimedia.org/r/#/c/161671/1/pywikibot/page.py,cm

So I'm not sure what we can do about that here. Maybe Page.init does change '' automatically to mainpage or so.

I can see a few ways to handle this in textlib.

  1. Ignore them in getLanguageLinks() like is done for [[en:{{PAGENAME}}]] which would result in removal if calling getLanguageLinks() then replaceLanguageLinks().
  2. Assume that they point to the main page in getLanguageLinks().
    • What about editing involving them?
      1. Convert to explicit form ([[en:Main Page]])
      2. Convert to implicit form ([[en:]])
      3. Track the form in getLanguageLinks() and use it in interwikiFormat()

2C is the ideal case, but I don't like the hacky implementation that I came up with (adding an attribute to the page in getLanguageLinks()).

Any thoughts on a preferred option?