Extension talk:Interwiki/Archive 1

Just a note to say that this works with 1.5 too! Thanks.

Database?
Maybe I'm doing something wrong, but is it supposed to produce the database tables for me, or do I have to create them? I keep getting errors that the table it wants doesn't exist. I don't mind editing them manually, but there doesn't appear to be any instructions for doing so... --69.250.40.75 03:09, 23 December 2005 (UTC)

Function error
Doesn't work in the new version(1.5.7) of wikimedia.

I get Fatal error: Call to undefined function: includable in /extensions/SpecialInterwiki.php on line 65 --Sgrayban 14:37, 24 March 2006 (UTC)


 * Me too, but mine's: Fatal error: Call to a member function on a non-object in /includes/SkinTemplate.php on line 306 - 154.20.86.196 05:25, 16 April 2006 (UTC)
 * Me too - Mediawiki 1.6.3, php 5.1.2, my error is: PHP Fatal error: Call to a member function getID on a non-object in /usr/local/www/data-dist/mediawiki/includes/SkinTemplate.php on line 306, referer: http://wiki.bitparts.org/index.php/Special:Specialpages 71.11.157.24 04:32, 20 April 2006 (UTC)
 * I also get this error: Fatal error: Call to a member function on a non-object in /includes/SkinTemplate.php on line 306 --68.220.84.93 21:29, 21 April 2006 (UTC)

Security fixes
The original version of this code had some bugs, including some security issues:
 * cross-site request forging
 * cross-site scripting via HTML/JavaScript injection
 * SQL injection

Additionally some of the HTML output wasn't well-formed so it would break XML-strict browsers when the wiki is configured for sending the 'real' XHTML Content-Type.

I've made some corrections to the copy on the wiki page:
 * Use of the edit token to protect against forged form submissions
 * Escaping of HTML output to protect against JavaScript injection/XSS
 * Switched from manual SQL (missing escaping) to the database query builder functions which provide safety automatically

Also the bug running on current 1.6 versions is fixed by adding the call to $this->setHeaders. --brion 08:26, 22 April 2006 (UTC)

SVN?
Anyone know what the process is on getting this into svn? It seems it would be of much more benefit there. --Ymmotrojam 17:47, 17 August 2006 (UTC)
 * Seconded. This is such a basic feature it ought to be at least in the Extensions Subversion repository, and probably in the main SVN. I don't know how to request that but I imagine Bugzilla is as good a way as any. Unfortunately Wikimedia's Bugzilla is down right now. --Kingboyk 17:31, 4 January 2007 (UTC)

Read-only version
Upon reflection, this doesn't really fulfill my need. To manipulate the interwiki list I just use phpMyAdmin or MS Access. What I would like - and I think this ought to be built-in Mediawiki - is a read-only list of interwiki links for the benefit of the users.

Anyway I'll have a play and maybe will come up with something I can post back here. --Kingboyk 19:59, 4 January 2007 (UTC)
 * OK, it's read only for those without privileges ("developer" group in my install). Works fine on 1.8.2 (r18799). --Kingboyk 20:15, 4 January 2007 (UTC)

Dutch translation
If you are interested in more translations, this is the Dutch (nl) translation: $wgSpecialInterwikiMessages['nl'] = array(       'interwiki' => 'Interwikidata bekijken en wijzigen',        'interwiki_delquestion' => '"$1" aan het verwijderen',        'interwiki_deleted' =>  '$1 is succesvol verwijderd van de interwikitabel.',        'interwiki_prefix' => 'Prefix',        'interwiki_prefix2' => 'Prefix:',        'interwiki_url' => 'URL',        'interwiki_local' => 'Local',        'interwiki_trans' => 'Trans',        'interwiki_delete' => 'Verwijderen',        'interwiki_yes' => 'Ja',        'interwiki_delfailed' => '$1 kon niet worden verwijderd van de interwikitabel.',        'interwiki_added' => '$1 is succesvol toegevoegd aan de interwikitabel.',        'interwiki_addfailed' => '$1 kon niet worden toegevoegd aan de interwikitabel.',        'interwiki_log_added' => 'Voegde "$1" ($2) (local: $3) (trans: $4) toe aan de interwikitabel: $5',        'interwiki_alreadyexists' => '$1 bestaat al in de interwikitabel!', 'interwiki_log_deleted' => 'Verwijderde prefix "$1" van de interwikitabel: $2', 'interwiki_add' => '*Een interwikiprefix toevoegen', 'interwiki_show' => '*Alle interwikiprefixen bekijken', 'interwiki_logpagename' => 'Logboek interwikitabel', 'interwiki_logpagetext' => 'Dit is een logboek van wijzigingen aan de interwikitabel.', 'interwiki_logentry' => '', 'interwiki_reasonfield' => 'Reden', 'interwiki_addtext' => 'Een interwikiprefix toevoegen', 'interwiki_delbutton' => 'Verwijderen', 'interwiki_addbutton' => 'Toevoegen', SPQRobin 12:51, 2 September 2007 (UTC)

How to add the translation file
I've added the SpecialInterwiki.i18n.php file, and I have to change something in the SpecialInterwiki.php file, but I don't know what. The information for this is unclear :-( SPQRobin 14:09, 22 September 2007 (UTC)


 * The necessary update to SpecialInterwiki.php is presented as a diff(1) - and not even one in unified format -, so I agree, it's unclear. Basically, though, all you need to do is replace the two blocks of lines marked with exclamation marks with the versions below. First of all,


 * becomes


 * And second, the entire block of $wgMessageCache->addMessage calls get replaced by:


 * Hope this helps. :) (Assuming you still need help with this, but if not, well, maybe the next person who's got the same problem will find this useful.) -- Schneelocke 17:33, 10 October 2007 (UTC)
 * This works. Thanks! SPQRobin 15:46, 12 October 2007 (UTC)

Suggestions
Here's a few things I'd suggest for this extension - any thoughts?


 * The warning message for empty interwiki tables should use the message cache.
 * The i18n patch should be integrated into the file.
 * The "add" form for new interwiki prefixes needs to be de-uglified.
 * The "add successful" message should present the interwiki table again for further edits (having to go back in your browser is annoying and breaks your workflow).

-- Schneelocke 17:41, 10 October 2007 (UTC)


 * I agree with you, except the i18n file should stay separately from the main file, but it should be mentioned in the main file by default (so there aren't problems like mine above :p). SPQRobin 15:46, 12 October 2007 (UTC)


 * I now changed the file so that it uses the i18n file by default (no need to patch). --MF-Warburg 08:09, 13 October 2007 (UTC)


 * Oh, yes, I agree, the i18n stuff should stay in a separate file. -- Schneelocke 19:40, 13 October 2007 (UTC)


 * I have "de-uglified" the add and delete form. I hope everyone finds it good :-) SPQRobin 15:09, 14 November 2007 (UTC)

Bug?
I think I have found a bug: Strange... SPQRobin 14:09, 13 October 2007 (UTC)
 * First, I go to the form to add a new prefix, e.g. 'mw' for http://www.mediawiki.org/, and I click on "local"
 * Then I see in the log and in the recent changes: (Added "mw" (http://www.mediawiki.org/wiki/$1) (local: 0) (trans: 1) to the interwiki table)
 * I was thinking "Maybe I clicked on 'trans' instead of 'local'?" But no, when I go to Special:Interwiki, I see in the table "local: 1" and "trans: 0"
 * We can just change the message
 * 'interwiki_log_added' => 'Added "$1" ($2) (local: $3) (trans: $4) to the interwiki table: $5',
 * to
 * 'interwiki_log_added' => 'Added "$1" ($2) (trans: $3) (local: $4) to the interwiki table: $5',
 * but I'm not sure this would be the right solution. SPQRobin 14:42, 13 October 2007 (UTC)
 * I looked to the source code and that is indeed the mistake. I've changed it. SPQRobin 18:17, 18 October 2007 (UTC)

Wrong Language
I installed this, it works, but I have to do some guessing work. Instead of English, is shows up as &#1055;&#1088;&#1086;&#1089;&#1084;&#1086;&#1090;&#1088; &#1080; &#1080;&#1079;&#1084;&#1077;&#1085;&#1077;&#1085;&#1080;&#1077; &#1087;&#1088;&#1077;&#1092;&#1080;&#1082;&#1089;&#1086;&#1074; &#1080;&#1085;&#1090;&#1077;&#1088;&#1074;&#1080;&#1082;&#1080;

Nothing shows up as English. IS there a way to change it? 69.54.2.147 21:48, 18 October 2007 (UTC)


 * Never mind, It's been fixed. I replaced

$wgMessageCache->addMessages( $wgSpecialInterwikiMessages[$key], $key );}

with

$wgMessageCache->addMessages( $wgSpecialInterwikiMessages[en], $key );} 69.54.2.147 22:35, 18 October 2007 (UTC)

Couple of bugs?
The page wasn't showing up in Special:Specialpages, so I changed the line 46 from

to

Was there any reason this wasn't done like this anyway?

Also, I was getting PHP errors about undefined variable out in lines 91 and 219. Obviously some paths through the function don't define this variable. To fix, I changed line 66: to

193.36.230.96 09:44, 23 November 2007 (UTC)


 * Which version of MediaWiki do you use? I use the latest version and it works fine. SPQRobin 16:07, 23 November 2007 (UTC)
 * Mediawiki 1.11 (and php 5.2.4). Do you mean the Special page shows up fine, or you don't get php errors? The latter will definitely happen through certain paths ($do = delete, delete2 and add2). Just to be clear, even though the page didn't show in Special:Specialpages, I could still access it at Special:Interwiki ok. My LocalSettings.php contains the lines below and I'm in the sysop group. 193.36.230.96 23:58, 23 November 2007 (UTC)


 * Everything works fine on my testwiki. Do you use the latest version of SVN? SPQRobin 12:35, 24 November 2007 (UTC)

Yes, the latest version. To reproduce the undefined variable problem: PHP Notice: Undefined variable: out in C:\\apache\\htdocs\\w\\extensions\\Interwiki\\SpecialInterwiki.php on line 91, referer: http://localhost/wiki/Special:Interwiki
 * 1) Go to Special:Interwiki.
 * 2) Click delete on any entry (you don't need to confirm the deletion).
 * 3) View your webserver error log (apache 2.2.4 in my case) and there will be an entry saying something like

If this doesn't produce an error, I guess your webserver must be different.

To reproduce the other problem: If this does work for you, I can only assume you have some different entries for your wgGroupPermissions and/or you are using a user account with different permissions
 * 1) Using latest version of extension in SVN, on MW v1.11.
 * 2) Add the following lines to LocalSettings.php
 * 1) Log in as a user with sysop (and beaurocrat) rights.
 * 2) Go to Special:Specialpages and there is no entry for Interwiki.