Page MenuHomePhabricator

After removing custom prefix from the interwiki table the old links still points to the target wikis
Closed, ResolvedPublic

Description

I downloaded [[mw:Extension:Interwiki]] and put the following on my
LocalSettings.php:

require_once("$IP/extensions/Interwiki/Interwiki.php");
$wgGroupPermissions['*']['interwiki'] = false;
$wgGroupPermissions['sysop']['interwiki'] = true;

Then, I went to [[Special:Interwikis]] and added prefix "w2" (http://pt.wikipedia.org/wiki/$1) (trans: 0) (local: 1) to
the interwiki table.

Next, I created a page with
*[[:w2:Main Page]], which points to http://pt.wikipedia.org/wiki/Main Page
*[[:w2:en:Main Page]], which points to http://pt.wikipedia.org/wiki/en:Main Page

Then I removed prefix "w2" from the interwiki table and made an edit on the page again. The links were still pointing to pt.wikipedia.org.

I think they should not be pointing there anymore after being deleted.


Version: unspecified
Severity: normal

Details

Reference
bz31992
ReferenceSource BranchDest BranchAuthorTitle
repos/cloud/toolforge/toolforge-deploy!142bump_builds-apimainraymond-ndibebuilds-api: bump to 0.0.110-20231205000727-2c3c4fa5
repos/cloud/toolforge/builds-cli!12log_followmainraymond-ndibe[build.logs]: add --follow option to build_logs
repos/cloud/toolforge/builds-api!46log_followmainraymond-ndibebuild logs: add follow option
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 11:57 PM
bzimport set Reference to bz31992.

Besides, if I recreate the prefix "w2" pointing to another site, it still points to the previous url (i.e. pt.wikipedia.org)

Using the "Edit" link doesn't change the target page either. The link will still point to the old URL...

Note, sql can be used to add these:

insert into interwiki (iw_prefix,iw_url,iw_local,iw_trans) values ('w2', 'http://pt.wikipedia.org/wiki/$1', 1, 0);
insert into interwiki (iw_prefix,iw_url,iw_local,iw_trans) values ('en2', 'http://en.wikibooks.org/wiki/$1', 1, 0);

Note that ?action=purge on pages where the links exist makes them disappear (become redlinks).

After action=purge, the links are still blue, and pointing to the old url.

The problem also happens on trunk version.

The command

select * from interwiki where iw_prefix in ('w2');

returns

Empty set (0.01 sec)

and this is consistent with the table displayed on [[Special:Interwikis]].

php maintenance/clear_interwiki_cache.php

I doubt any wiki outside WMF uses the interwiki cache, as the script building it is WMF-specific (in WikimediaMaintenance). It is impossible to modify the interwiki cache through Special:Interwiki.

And clear_interwiki_cache.php clears, well, the interwiki cache so this won't have any effect.

And I haven't had the described problem, it works for me.

Correction for my previous comment:

Now I understand that there are two types of interwiki caching, and clear_interwiki_cache.php is for the memcached caching, so in case the wiki uses memcached, clear_interwiki_cache.php can indeed be used.

I documented this on https://www.mediawiki.org/wiki/Interwiki_cache, there was almost no documentation on this.

So what the Interwiki extension could do is just clear the cache for the deleted prefix. Should be simple enough.

Correction again :)

Apparently this has been fixed in the extension a month ago, in r114912. So it will delete the interwiki prefix in memcached too, when deleting a prefix through Special:Interwiki.

So, assuming the bug reporter was using memcached, I'm marking this bug as resolved.