Merge "Localisation updates from http://translatewiki.net."
authorTranslation updater bot <l10n-bot@translatewiki.net>
Wed, 7 Nov 2012 20:39:03 +0000 (20:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 7 Nov 2012 20:39:03 +0000 (20:39 +0000)
15 files changed:
RELEASE-NOTES-1.20
RELEASE-NOTES-1.21
docs/hooks.txt
includes/User.php
includes/content/ContentHandler.php
includes/db/ORMRow.php
includes/filerepo/file/ArchivedFile.php
includes/site/SitesTable.php
includes/specials/SpecialListusers.php
includes/specials/SpecialSearch.php
resources/jquery/jquery.badge.css
tests/parser/parserTests.txt
tests/phpunit/includes/db/ORMRowTest.php
tests/phpunit/includes/db/TestORMRowTest.php
tests/phpunit/includes/site/SiteObjectTest.php

index 52c4e86..1a92968 100644 (file)
@@ -5,10 +5,7 @@ setting since version 1.2.0. If you have it on, turn it '''off''' if you can.
 
 == MediaWiki 1.20 ==
 
-THIS IS NOT A RELEASE YET
-
-MediaWiki 1.20 is an alpha-quality branch and is not recommended for use in
-production.
+MediaWiki 1.20 is a stable release.
 
 === PHP 5.3 now required ===
 Since 1.20, the lowest supported version of PHP is now 5.3.2. Please
@@ -152,7 +149,32 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 40448) mediawiki.legacy.mwsuggest has been replaced with a new module,
   mediawiki.searchSuggest, based on SimpleSeach from Extension:Vector.
 
+=== Known issues in 1.20.0 ===
+These are issues that we're targeting to be fixed in a later release
+in the 1.20 series.  Issues may be added or removed from this list as
+we see fit.  For now, it is comprised of those bugs on the 1.20.0
+milestone in Bugzilla.
+
+* (bug 35894): Reports of secret key generation "hanging" on windows
+    This is probably a bug that has been fixed in PHP.  If you run
+    into this, try upgrading your PHP.
+* (bug 38334): PHP Notice:  Undefined index: href in /www/w/skins/Vector.php on line 416
+    We think this is a problem in some extension.  If you see this,
+    try disabling your extensions and check out the logging patch on
+    this bug.  Or try this patch:
+    <https://gerrit.wikimedia.org/r/#/c/27937/1/skins/Vector.php>
+* (bug 39268): [Regression] Toolbar inserts in main textarea only (instead of the focussed textarea)
+    This should only be an issue if you are using the ProofreadPage
+    extension.
+* (bug 40641): Clicking "others" in Special:Version asks to download a file
+    If you encounter this, you can tell your webserver to serve the
+    CREDITS file with text/plain MIME type to fix it.
+
 === Bug fixes in 1.20 ===
+* (bug 40939): [Regression] InfoAction: Call to a member function getUserText() on a non-object
+* (bug 40780): searchsuggest-containing line ("containing...") doesn't include the entered text
+* (bug 37714): [Regression] Incomplete log entries
+* (bug 27202): API: Add timestamp sort to list=allimages
 * (bug 30245) Use the correct way to construct a log page title.
 * (bug 34237) Regenerate an empty user_token and save to the database
   when we try to set the user's cookies for login.
index ce6966e..4be260e 100644 (file)
@@ -58,6 +58,8 @@ production.
   caught during API execution.
 * (bug 37963) Fixed loading process for user options
 * (bug 26995) Update filename field on Upload page after having sanitized it.
+* (bug 41793) Contribution links to users with 0 edits on Special:ListUsers didn't
+  show up red.
 
 === API changes in 1.21 ===
 * prop=revisions can now report the contentmodel and contentformat, see docs/contenthandler.txt
index 94cf08e..d02118f 100644 (file)
@@ -1831,6 +1831,21 @@ $result: The search result
 $terms: The search terms entered
 $page: The SpecialSearch object.
 
+'ShowSearchHit': Customize display of search hit.
+$searchPage: The SpecialSearch instance.
+$result: The SearchResult to show
+$terms: Search terms, for highlighting
+&$link: HTML of link to the matching page. May be modified.
+&$redirect: HTML of redirect info. May be modified.
+&$section: HTML of matching section. May be modified.
+&$extract: HTML of content extract. May be modified.
+&$score: HTML of score. May be modified.
+&$size: HTML of page size. May be modified.
+&$date: HTML of of page modification date. May be modified.
+&$related: HTML of additional info for the matching page. May be modified.
+&$html: May be set to the full HTML that should be used to represent the search hit. Must include
+the <li> ... </li> tags. Will only be used if the hook function returned false.
+
 'SiteNoticeBefore': Before the sitenotice/anonnotice is composed
 &$siteNotice: HTML returned as the sitenotice
 $skin: Skin object
index c0d71e4..f02cc29 100644 (file)
@@ -2469,7 +2469,7 @@ class User {
                                        $count = $this->initEditCount();
                                }
                                wfProfileOut( __METHOD__ );
-                               $this->mEditCount = $count;
+                               $this->mEditCount = intval( $count );
                        }
                        return $this->mEditCount;
                } else {
index ee2f2ed..b61dc34 100644 (file)
@@ -582,8 +582,6 @@ abstract class ContentHandler {
                $rcid = 0, # FIXME: use everywhere!
                $refreshCache = false, $unhide = false
        ) {
-               $this->checkModelID( $context->getTitle()->getContentModel() );
-
                $diffEngineClass = $this->getDiffEngineClass();
 
                return new $diffEngineClass( $context, $old, $new, $rcid, $refreshCache, $unhide );
index a8d0850..affd65f 100644 (file)
@@ -263,8 +263,10 @@ abstract class ORMRow implements IORMRow {
                                switch ( $type ) {
                                        case 'array':
                                                $value = (array)$value;
+                                               // fall-through!
                                        case 'blob':
                                                $value = serialize( $value );
+                                               // fall-through!
                                }
 
                                $values[$this->table->getPrefixedField( $name )] = $value;
@@ -391,7 +393,7 @@ abstract class ORMRow implements IORMRow {
                        $this->table->getName(),
                        $this->getWriteValues(),
                        is_null( $functionName ) ? __METHOD__ : $functionName,
-                       is_null( $options ) ? array( 'IGNORE' ) : $options
+                       $options
                );
 
                // DatabaseBase::insert does not always return true for success as documented...
index 694623b..e1a8547 100644 (file)
@@ -135,8 +135,9 @@ class ArchivedFile {
                }
 
                if( !$this->title || $this->title->getNamespace() == NS_FILE ) {
+                       $this->dataLoaded = true; // set it here, to have also true on miss
                        $dbr = wfGetDB( DB_SLAVE );
-                       $res = $dbr->select( 'filearchive',
+                       $row = $dbr->selectRow( 'filearchive',
                                array(
                                        'fa_id',
                                        'fa_name',
@@ -159,20 +160,18 @@ class ArchivedFile {
                                        'fa_sha1' ),
                                $conds,
                                __METHOD__,
-                               array( 'ORDER BY' => 'fa_timestamp DESC' ) );
-                       if ( $res == false || $dbr->numRows( $res ) == 0 ) {
-                       // this revision does not exist?
+                               array( 'ORDER BY' => 'fa_timestamp DESC')
+                       );
+                       if ( !$row ) {
+                               // this revision does not exist?
                                return null;
                        }
-                       $ret = $dbr->resultObject( $res );
-                       $row = $ret->fetchObject();
 
                        // initialize fields for filestore image object
                        $this->loadFromRow( $row );
                } else {
                        throw new MWException( 'This title does not correspond to an image page.' );
                }
-               $this->dataLoaded = true;
                $this->exists = true;
 
                return true;
index a03c598..bb12740 100644 (file)
@@ -95,6 +95,7 @@ class SitesTable extends ORMTable {
 
                        'forward' => false,
                        'config' => array(),
+                       'language' => 'en', // XXX: can we default to '' instead?
                );
        }
 
index 8b44828..ea598c3 100644 (file)
@@ -153,7 +153,7 @@ class UsersPager extends AlphabeticPager {
                $userName = $row->user_name;
 
                $ulinks = Linker::userLink( $row->user_id, $userName );
-               $ulinks .= Linker::userToolLinks( $row->user_id, $userName );
+               $ulinks .= Linker::userToolLinksRedContribs( $row->user_id, $userName, intval( $row->edits ) );
 
                $lang = $this->getLanguage();
 
index 6c33bb8..7c8ff84 100644 (file)
@@ -684,11 +684,21 @@ class SpecialSearch extends SpecialPage {
                        }
                }
 
-               wfProfileOut( __METHOD__ );
-               return "<li><div class='mw-search-result-heading'>{$link} {$redirect} {$section}</div> {$extract}\n" .
-                       "<div class='mw-search-result-data'>{$score}{$size} - {$date}{$related}</div>" .
-                       "</li>\n";
+               $html = null;
+
+               if ( wfRunHooks( 'ShowSearchHit', array (
+                       $this, $result, $terms,
+                       &$link, &$redirect, &$section, &$extract,
+                       &$score, &$size, &$date, &$related,
+                       &$html
+               ) ) ) {
+                       $html = "<li><div class='mw-search-result-heading'>{$link} {$redirect} {$section}</div> {$extract}\n" .
+                               "<div class='mw-search-result-data'>{$score}{$size} - {$date}{$related}</div>" .
+                               "</li>\n";
+               }
 
+               wfProfileOut( __METHOD__ );
+               return $html;
        }
 
        /**
index b8bec8c..7dd2198 100644 (file)
@@ -9,12 +9,12 @@
        background-color: #cc0000;
        padding: 0 3px;
        text-align: center;
+       font-size: 12px;
+       line-height: 12px;
 }
 
 .mw-badge-content {
-       font-size: 12px;
        font-weight: bold;
-       line-height: 12px;
        color: white;
        vertical-align: baseline;
        text-shadow: 0 1px rgba(0, 0, 0, 0.4);
index 2f20fbc..2fa8a50 100644 (file)
@@ -48,7 +48,7 @@ Template:Blank
 !! endarticle
 
 !! article
-Template:!
+Template:pipe
 !! text
 |
 !! endarticle
@@ -65,6 +65,12 @@ Template:inner list
 * item 1
 !! endarticle
 
+!! article
+Template:!
+!! text
+|
+!! endarticle
+
 !! article
 Template:echo
 !! text
@@ -964,6 +970,8 @@ Templates: Pre: 1e. Wrapping should be based on expanded content
 !!input
 {{echo| foo}}
 
+{{echo| foo}}{{echo| bar}}
+
 {{echo| foo}}
 {{echo| bar}}
 
@@ -975,6 +983,8 @@ Templates: Pre: 1e. Wrapping should be based on expanded content
 !!result
 <pre>foo
 </pre>
+<pre>foo bar
+</pre>
 <pre>foo
 bar
 </pre>
@@ -986,6 +996,43 @@ bar
 </pre>
 !!end
 
+!! test
+Templates: Pre: 1f: Wrapping should be based on expanded content
+!! input
+{{echo| }}a
+
+{{echo|
+ }}a
+
+{{echo|
+ b}}
+
+{{echo|a
+ }}b
+
+{{echo|a
+}} b
+!!result
+<pre>a
+</pre>
+<p><br />
+</p>
+<pre>a
+</pre>
+<p><br />
+</p>
+<pre>b
+</pre>
+<p>a
+</p>
+<pre>b
+</pre>
+<p>a
+</p>
+<pre>b
+</pre>
+!!end
+
 ###
 ### Parsoid-centric tests for testing RT edge cases for pre
 ###
@@ -1067,7 +1114,7 @@ c
 !!end
 
 !!test
-3. Pre and block tags
+3a. Pre and block tags (single-line html)
 !!input
  <p> foo </p>
  <div> foo </div>
@@ -1079,6 +1126,58 @@ c
 </pre>
 !!end
 
+!!test
+3b. Pre and block tags (pre-content on separate line)
+!!input
+<p>
+ foo
+</p>
+
+<div>
+ foo
+</div>
+
+<center>
+ foo
+</center>
+
+<blockquote>
+ foo
+</blockquote>
+
+<table><tr><td>
+ foo
+</td></tr></table>
+
+<ul><li>
+  foo
+</li></ul>
+
+!!result
+<p>
+ foo
+</p>
+<div>
+<pre>foo
+</pre>
+</div>
+<center>
+<pre>foo
+</pre>
+</center>
+<blockquote>
+ foo
+</blockquote>
+<table><tr><td>
+<pre>foo
+</pre>
+</td></tr></table>
+<ul><li>
+  foo
+</li></ul>
+
+!!end
+
 !!test
 4. Multiple spaces at start-of-line
 !!input
@@ -1235,13 +1334,13 @@ Bug 11748: Literal closing tags
 Definition and unordered list using wiki syntax nested in unordered list using html tags.
 !! input
 <ul><li>
-; term : description 
+; term : description
 * unordered
 </li>
 </ul>
 !! result
 <ul><li>
-<dl><dt> term&#160;</dt><dd> description 
+<dl><dt> term&#160;</dt><dd> description
 </dd></dl>
 <ul><li> unordered
 </li></ul>
@@ -2364,9 +2463,9 @@ A table with nothing but a caption
 !! test
 Simple table
 !! input
-{| 
+{|
 | 1 || 2
-|- 
+|-
 | 3 || 4
 |}
 !! result
@@ -2385,7 +2484,7 @@ Simple table
 !! test
 Simple table but with multiple dashes for row wikitext
 !! input
-{| 
+{|
 | foo
 |-----
 | bar
@@ -2498,12 +2597,12 @@ Allow +/- in 2nd and later cells in a row
 Table rowspan
 !! input
 {| border=1
-| Cell 1, row 1 
-|rowspan=2| Cell 2, row 1 (and 2) 
-| Cell 3, row 1 
-|- 
-| Cell 1, row 2 
-| Cell 3, row 2 
+| Cell 1, row 1
+|rowspan=2| Cell 2, row 1 (and 2)
+| Cell 3, row 1
+|-
+| Cell 1, row 2
+| Cell 3, row 2
 |}
 !! result
 <table border="1">
@@ -4199,7 +4298,7 @@ Template with complex arguments
 !! test
 BUG 553: link with two variables in a piped link
 !! input
-{| 
+{|
 |[[{{{1}}}|{{{2}}}]]
 |}
 !! result
@@ -4307,9 +4406,9 @@ Template from main namespace
 !! article
 Template:table
 !! text
-{| 
+{|
 | 1 || 2
-|- 
+|-
 | 3 || 4
 |}
 !! endarticle
@@ -4801,7 +4900,7 @@ Templates: HTML Tag: 6. Generation of end piece of HTML attr value
 !!end
 
 !!test
-Templates: Tables: 1. Generating start of a HTML table
+Templates: HTML Tables: 1. Generating start of a HTML table
 !!input
 {{echo|<table><tr><td>foo</td>}}</tr></table>
 !!result
@@ -4810,7 +4909,7 @@ Templates: Tables: 1. Generating start of a HTML table
 !!end
 
 !!test
-Templates: Tables: 2a. Generating middle of a HTML table
+Templates: HTML Tables: 2a. Generating middle of a HTML table
 !!input
 <table><tr>{{echo|<td>foo</td>}}</tr></table>
 !!result
@@ -4819,7 +4918,7 @@ Templates: Tables: 2a. Generating middle of a HTML table
 !!end
 
 !!test
-Templates: Tables: 2b. Generating middle of a HTML table
+Templates: HTML Tables: 2b. Generating middle of a HTML table
 !!input
 <table>{{echo|<tr><td>foo</td></tr>}}</table>
 !!result
@@ -4828,7 +4927,7 @@ Templates: Tables: 2b. Generating middle of a HTML table
 !!end
 
 !!test
-Templates: Tables: 3. Generating end of a HTML table
+Templates: HTML Tables: 3. Generating end of a HTML table
 !!input
 <table><tr>{{echo|<td>foo</td></tr></table>}}
 !!result
@@ -4837,7 +4936,7 @@ Templates: Tables: 3. Generating end of a HTML table
 !!end
 
 !!test
-Templates: Tables: 4a. Generating a single tag of a HTML table
+Templates: HTML Tables: 4a. Generating a single tag of a HTML table
 !!input
 {{echo|<table>}}<tr><td>foo</td></tr></table>
 !!result
@@ -4846,7 +4945,7 @@ Templates: Tables: 4a. Generating a single tag of a HTML table
 !!end
 
 !!test
-Templates: Tables: 4b. Generating a single tag of a HTML table
+Templates: HTML Tables: 4b. Generating a single tag of a HTML table
 !!input
 <table>{{echo|<tr>}}<td>foo</td></tr></table>
 !!result
@@ -4855,7 +4954,7 @@ Templates: Tables: 4b. Generating a single tag of a HTML table
 !!end
 
 !!test
-Templates: Tables: 4c. Generating a single tag of a HTML table
+Templates: HTML Tables: 4c. Generating a single tag of a HTML table
 !!input
 <table><tr>{{echo|<td>}}foo</td></tr></table>
 !!result
@@ -4864,7 +4963,7 @@ Templates: Tables: 4c. Generating a single tag of a HTML table
 !!end
 
 !!test
-Templates: Tables: 4d. Generating a single tag of a HTML table
+Templates: HTML Tables: 4d. Generating a single tag of a HTML table
 !!input
 <table><tr><td>foo{{echo|</td>}}</tr></table>
 !!result
@@ -4873,7 +4972,7 @@ Templates: Tables: 4d. Generating a single tag of a HTML table
 !!end
 
 !!test
-Templates: Tables: 4e. Generating a single tag of a HTML table
+Templates: HTML Tables: 4e. Generating a single tag of a HTML table
 !!input
 <table><tr><td>foo</td>{{echo|</tr>}}</table>
 !!result
@@ -4882,7 +4981,7 @@ Templates: Tables: 4e. Generating a single tag of a HTML table
 !!end
 
 !!test
-Templates: Tables: 4f. Generating a single tag of a HTML table
+Templates: HTML Tables: 4f. Generating a single tag of a HTML table
 !!input
 <table><tr><td>foo</td></tr>{{echo|</table>}}
 !!result
@@ -4890,6 +4989,62 @@ Templates: Tables: 4f. Generating a single tag of a HTML table
 
 !!end
 
+!!test
+Templates: Wiki Tables: 1. Fostering of entire template content
+!!input
+{|
+{{echo|a}}
+|}
+!!result
+<table>
+a
+<tr><td></td></tr></table>
+
+!!end
+
+!!test
+Templates: Wiki Tables: 2. Fostering of partial template content
+!!input
+{|
+{{echo|a
+<div>b</div>}}
+|}
+!!result
+<table>
+a
+<div>b</div>
+<tr><td></td></tr></table>
+
+!!end
+
+!!test
+Templates: Wiki Tables: 3. td-content via multiple templates
+!!input
+{|
+{{echo|{{pipe}}a}}{{echo|b}}
+|}
+!!result
+<table>
+<tr>
+<td>ab
+</td></tr></table>
+
+!!end
+
+!!test
+Templates: Lists: Multi-line list-items via templates
+!!input
+*{{echo|a {{nonexistent|
+unused}}}}
+*{{echo|b {{nonexistent|
+unused}}}}
+!!result
+<ul><li>a <a href="/index.php?title=Template:Nonexistent&amp;action=edit&amp;redlink=1" class="new" title="Template:Nonexistent (page does not exist)">Template:Nonexistent</a>
+</li><li>b <a href="/index.php?title=Template:Nonexistent&amp;action=edit&amp;redlink=1" class="new" title="Template:Nonexistent (page does not exist)">Template:Nonexistent</a>
+</li></ul>
+
+!!end
+
 !!test
 Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo)
 !!input
@@ -11587,7 +11742,7 @@ Headings: 0. Unnested
 !!end
 
 !! test
-Headings: 1. Nested inside html 
+Headings: 1. Nested inside html
 !! options
 disabled
 !! input
@@ -11624,7 +11779,7 @@ disabled
 !!end
 
 !! test
-Headings: 3. Nested inside html with wikitext split by html tags 
+Headings: 3. Nested inside html with wikitext split by html tags
 !! options
 disabled
 !! input
@@ -11696,7 +11851,7 @@ disabled
 #### ----------------------------------------
 
 !! test
-Lists: 0. Outside nests 
+Lists: 0. Outside nests
 !! input
 <nowiki>*foo</nowiki>
 
@@ -11840,7 +11995,7 @@ disabled
 !!end
 
 !! test
-Lists: 7. Escape bullets in a multi-line context 
+Lists: 7. Escape bullets in a multi-line context
 !! input
 <nowiki>a
 *b</nowiki>
@@ -11855,7 +12010,7 @@ Lists: 7. Escape bullets in a multi-line context
 #### -----------------------------------
 
 !! test
-HRs: 1. Single line 
+HRs: 1. Single line
 !! options
 disabled
 !! input
@@ -12189,7 +12344,7 @@ disabled
 
 !! test
 2. Link fragments inside <i> and <b>
-(FIXME: Escaping one or both of [[ and ]] is also acceptable -- 
+(FIXME: Escaping one or both of [[ and ]] is also acceptable --
  this is one of the shortcomings of this format)
 !! input
 ''[[foo''<nowiki>]]</nowiki>
index 9dcaf2b..cd970b3 100644 (file)
@@ -155,12 +155,11 @@ abstract class ORMRowTest extends \MediaWikiTestCase {
 
        /**
         * @dataProvider constructorTestProvider
+        * @depends testSave()
         */
        public function testRemove( array $data, $loadDefaults ) {
                $item = $this->getRowInstance( $data, $loadDefaults );
 
-               $this->assertTrue( $item->save() );
-
                $this->assertTrue( $item->remove() );
 
                $this->assertFalse( $item->hasIdField() );
index c7bea3b..e33ae01 100644 (file)
@@ -87,6 +87,7 @@ class TestORMRowTest extends ORMRowTest {
                        array(
                                array(
                                        'name' => 'Foobar',
+                                       'time' => '20120101020202',
                                        'age' => 42,
                                        'height' => 9000.1,
                                        'awesome' => true,
index e8358f3..207f46c 100644 (file)
@@ -25,6 +25,7 @@
  * @ingroup Test
  *
  * @group Site
+ * @group Database
  *
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < jeroendedauw@gmail.com >
@@ -57,9 +58,9 @@ class SiteObjectTest extends ORMRowTest {
        public function constructorTestProvider() {
                $argLists = array();
 
-               $argLists[] = array( 'global_key' => '42' );
+               $argLists[] = array( 'global_key' => 'foo' );
 
-               $argLists[] = array( 'global_key' => '42', 'type' => Site::TYPE_MEDIAWIKI );
+               $argLists[] = array( 'global_key' => 'bar', 'type' => Site::TYPE_MEDIAWIKI );
 
                $constructorArgs = array();
 
@@ -229,6 +230,17 @@ class SiteObjectTest extends ORMRowTest {
                $this->assertEquals( $path, $site->getPath( 'foo' ) );
        }
 
+       public function testProtocolRelativePath() {
+               /* @var SiteObject $site */
+               $site = $this->getRowInstance( $this->getMockFields(), false );
+
+               $type = $site->getLinkPathType();
+               $path = '//acme.com/'; // protocol-relative URL
+               $site->setPath( $type, $path );
+
+               $this->assertEquals( '', $site->getProtocol() );
+       }
+
        public function provideGetPageUrl() {
                //NOTE: the assumption that the URL is built by replacing $1
                //      with the urlencoded version of $page