WikidataBuilder has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316058

Change subject: New Wikidata Build - 2016-10-15T10:00:01+0000
......................................................................

New Wikidata Build - 2016-10-15T10:00:01+0000

Change-Id: Ie15c031c6eb74ccf5db80dc8493fd807906a8049
---
M composer.lock
M extensions/ValueView/RELEASE-NOTES.md
M extensions/ValueView/ValueView.php
M extensions/ValueView/i18n/en.json
M extensions/ValueView/i18n/qqq.json
M extensions/ValueView/lib/jquery.ui/jquery.ui.commonssuggester.js
M extensions/ValueView/src/experts/GlobeCoordinateInput.js
M extensions/ValueView/src/experts/resources.php
M extensions/ValueView/src/jquery.valueview.valueview.js
A extensions/ValueView/tests/lib/jquery.ui/jquery.ui.commonssuggester.tests.js
M extensions/ValueView/tests/lib/jquery.ui/jquery.ui.suggester.tests.js
M extensions/ValueView/tests/lib/resources.php
M extensions/Wikibase/client/i18n/vro.json
M extensions/Wikibase/client/i18n/zh-hant.json
M extensions/Wikibase/client/includes/Specials/SpecialEntityUsage.php
M 
extensions/Wikibase/client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php
M extensions/Wikibase/composer.json
M extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php
M extensions/Wikibase/lib/tests/phpunit/Store/EntityInfoBuilderTest.php
M extensions/Wikibase/repo/i18n/de.json
M extensions/Wikibase/repo/i18n/en.json
M extensions/Wikibase/repo/i18n/pt.json
M extensions/Wikibase/repo/i18n/qqq.json
M extensions/Wikibase/repo/includes/Actions/SubmitEntityAction.php
M 
extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementview.RankSelector.js
M extensions/Wikibase/view/resources/jquery/wikibase/resources.php
M vendor/composer/installed.json
27 files changed, 401 insertions(+), 70 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata 
refs/changes/58/316058/1

diff --git a/composer.lock b/composer.lock
index 9cadb17..fd65a2a 100644
--- a/composer.lock
+++ b/composer.lock
@@ -674,16 +674,16 @@
         },
         {
             "name": "data-values/value-view",
-            "version": "0.17.4",
+            "version": "0.18.0",
             "source": {
                 "type": "git",
                 "url": 
"https://github.com/wikimedia/data-values-value-view.git";,
-                "reference": "094a35216990d62daf104037edd3d593d406d80d"
+                "reference": "5938027bbbad63e54cfa0266db211bac5fa902b2"
             },
             "dist": {
                 "type": "zip",
-                "url": 
"https://api.github.com/repos/wikimedia/data-values-value-view/zipball/094a35216990d62daf104037edd3d593d406d80d";,
-                "reference": "094a35216990d62daf104037edd3d593d406d80d",
+                "url": 
"https://api.github.com/repos/wikimedia/data-values-value-view/zipball/5938027bbbad63e54cfa0266db211bac5fa902b2";,
+                "reference": "5938027bbbad63e54cfa0266db211bac5fa902b2",
                 "shasum": ""
             },
             "require": {
@@ -721,7 +721,7 @@
             ],
             "description": "Provides JS widgets to edit values defined by the 
DataValues library",
             "homepage": "https://www.mediawiki.org/wiki/Extension:ValueView";,
-            "time": "2016-10-05 14:27:34"
+            "time": "2016-10-14 12:19:21"
         },
         {
             "name": "diff/diff",
@@ -1574,12 +1574,12 @@
             "source": {
                 "type": "git",
                 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-                "reference": "7f7a926567984089c1c157da35f19260d18bd7c9"
+                "reference": "925de4a0469c5fe4727eba81704ce67833f8e78c"
             },
             "dist": {
                 "type": "zip",
-                "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/7f7a926567984089c1c157da35f19260d18bd7c9";,
-                "reference": "7f7a926567984089c1c157da35f19260d18bd7c9",
+                "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/925de4a0469c5fe4727eba81704ce67833f8e78c";,
+                "reference": "925de4a0469c5fe4727eba81704ce67833f8e78c",
                 "shasum": ""
             },
             "require": {
@@ -1593,7 +1593,7 @@
                 "data-values/serialization": "~1.1",
                 "data-values/time": "~0.8.4",
                 "data-values/validators": "~0.1.0",
-                "data-values/value-view": "~0.17.3",
+                "data-values/value-view": "~0.18.0",
                 "diff/diff": "~2.0",
                 "php": ">=5.5.0",
                 "wikibase/data-model": "~6.1",
@@ -1653,7 +1653,7 @@
                 "wikibaserepo",
                 "wikidata"
             ],
-            "time": "2016-10-13 08:27:02"
+            "time": "2016-10-14 15:29:48"
         },
         {
             "name": "wikibase/wikimedia-badges",
diff --git a/extensions/ValueView/RELEASE-NOTES.md 
b/extensions/ValueView/RELEASE-NOTES.md
index 26b0f6b..2e273c6 100644
--- a/extensions/ValueView/RELEASE-NOTES.md
+++ b/extensions/ValueView/RELEASE-NOTES.md
@@ -1,5 +1,9 @@
 # ValueView release notes
 
+## 0.18.0 (2016-10-14)
+* `jQuery.ui.commonssuggester` now allows pasting full and partial Wikimedia 
Commons URLs.
+* Added support for `null` precision to `GlobeCoordinateInput`.
+
 ## 0.17.4 (2016-10-05)
 * Handle null upstream values in 
`jQuery.valueview.ExpertExtender.LanguageSelector::onInitialShow`.
 * Properly forward API error messages in `jquery.ui.unitsuggester`.
diff --git a/extensions/ValueView/ValueView.php 
b/extensions/ValueView/ValueView.php
index 9a472b4..cc535df 100644
--- a/extensions/ValueView/ValueView.php
+++ b/extensions/ValueView/ValueView.php
@@ -5,7 +5,7 @@
        return 1;
 }
 
-define( 'VALUEVIEW_VERSION', '0.17.4' );
+define( 'VALUEVIEW_VERSION', '0.18.0' );
 
 // Include the composer autoloader if it is present.
 if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
diff --git a/extensions/ValueView/i18n/en.json 
b/extensions/ValueView/i18n/en.json
index e18bf3b..5200c8f 100644
--- a/extensions/ValueView/i18n/en.json
+++ b/extensions/ValueView/i18n/en.json
@@ -11,6 +11,7 @@
        "valueview-expert-unsupportedvalue-unsupporteddatatype": "Handling of 
values for \"$1\" data type is not yet supported.",
        "valueview-expert-emptyvalue-empty": "empty",
        "valueview-expert-globecoordinateinput-precision": "Precision:",
+       "valueview-expert-globecoordinateinput-nullprecision": "unspecified",
        "valueview-expert-globecoordinateinput-customprecision": "special ($1)",
        "valueview-expert-timevalue-calendar-gregorian": "Gregorian",
        "valueview-expert-timevalue-calendar-julian": "Julian",
diff --git a/extensions/ValueView/i18n/qqq.json 
b/extensions/ValueView/i18n/qqq.json
index ca40add..cc135ff 100644
--- a/extensions/ValueView/i18n/qqq.json
+++ b/extensions/ValueView/i18n/qqq.json
@@ -15,11 +15,16 @@
        "valueview-expert-unsupportedvalue-unsupporteddatatype": "Error shown 
if a data value for a certain data type (see [[d:Wikidata:Glossary]]) should be 
displayed or a form for creating one should be offered while this is not yet 
possible from a technical point of view (e.g. because a valueview widget expert 
handling data values for that data type has not yet been 
implemented).\n\nParameters:\n* $1 - the name of the data type which lacks 
support",
        "valueview-expert-emptyvalue-empty": "Message expressing that there is 
currently no value set in a jQuery valueview.\n{{Identical|Empty}}",
        "valueview-expert-globecoordinateinput-precision": "Label for the user 
interface element used to set a specific precision (e.g. 1, 0.1, 0.001) when 
entering a coordinate value.\n{{Identical|Precision}}",
-       "valueview-expert-globecoordinateinput-customprecision": 
"{{Identical|Special}}",
-       "valueview-expert-timevalue-calendar-gregorian": "Label of the 
GREGORIAN calendar. The label is used for selecting the GREGORIAN calendar 
model when entering a date and is displayed with dates that refer to that 
calendar model.\n\nSee also:\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-gregorian}}\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-switch-gregorian}}",
-       "valueview-expert-timevalue-calendar-julian": "Label of the JULIAN 
calendar. The label is used for selecting the JULIAN calendar model when 
entering a date and is displayed with dates that refer to that calendar 
model.\n\nSee also:\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-julian}}\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-switch-julian}}",
+       "valueview-expert-globecoordinateinput-nullprecision": "Label 
describing the meaning of the coordinate precision \"null\". Usually it means 
there was no precision specified when the value was entered, other than the 
precision that can be guessed based on the number of fractional digits of the 
latitude and longitude values.",
+       "valueview-expert-globecoordinateinput-customprecision": "Label 
wrapping a custom precision the user can not select when entering 
coordinates.\n\nParameters\n* $1 - the precision value as a decimal 
number\n{{Identical|Special}}",
+       "valueview-expert-timevalue-calendar-gregorian": "Label of the 
GREGORIAN calendar. The label is used for selecting the GREGORIAN calendar 
model when entering a date and is displayed with dates that refer to that 
calendar model.\n\nSee also:\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-gregorian}}\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-switch-gregorian}}\n{{Identical|Gregorian}}",
+       "valueview-expert-timevalue-calendar-julian": "Label of the JULIAN 
calendar. The label is used for selecting the JULIAN calendar model when 
entering a date and is displayed with dates that refer to that calendar 
model.\n\nSee also:\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-julian}}\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-switch-julian}}\n{{Identical|Julian}}",
        "valueview-expert-timeinput-precision": "Label for the user interface 
element used to set a specific precision (e.g. hour, day, month, year) when 
entering a time value.\n{{Identical|Precision}}",
        "valueview-expert-timeinput-calendar": "Label for the user interface 
element used to select a specific calendar (e.g. Gregorian, Julian) entering a 
time value.\n\nThe calendar is not localized at this 
time.\n{{Identical|Calendar}}",
+       "valueview-expertextender-calendarhint-gregorian": "Message informing 
that the GREGORIAN calendar has been detected automatically while specifying a 
date. The message is shown only when the specified date lies within a time 
frame when multiple calendars had been in use.\n\nSee also:\n* 
{{msg-mw|Valueview-expert-timevalue-calendar-gregorian}}\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-switch-gregorian}}",
+       "valueview-expertextender-calendarhint-julian": "Message informing that 
the JULIAN calendar has been detected automatically while specifying a date. 
The message is shown only when the specified date lies within a time frame when 
multiple calendars had been in use.\n\nSee also:\n* 
{{msg-mw|Valueview-expert-timevalue-calendar-julian}}\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-switch-julian}}",
+       "valueview-expertextender-calendarhint-switch-gregorian": "Label of the 
link manually switching to the GREGORIAN calendar. The link is located directly 
at the preview (in combination with the calendar hint message).\n\nSee also:\n* 
{{msg-mw|Valueview-expert-timevalue-calendar-gregorian}}\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-gregorian}}",
+       "valueview-expertextender-calendarhint-switch-julian": "Label of the 
link manually switching to the JULIAN calendar. The link is located directly at 
the preview (in combination with the calendar hint message).\n\nSee also:\n* 
{{msg-mw|Valueview-expert-timevalue-calendar-julian}}\n* 
{{msg-mw|Valueview-expert-timeinput-calendarhint-julian}}",
        "valueview-expertextender-languageselector-languagetemplate": "Defines 
how the language should be displayed relative to the text.\n\nParameters:\n* $1 
- the text.\n* $2 - the language name or code.",
        "valueview-expertextender-languageselector-label": "Label displayed 
above the language input. The input is either a plain text field or a search 
with a suggester.",
        "valueview-expertextender-unitsuggester-label": "Label displayed above 
the quantity's unit input. The input is a plain text field with an optional 
suggester.",
diff --git a/extensions/ValueView/lib/jquery.ui/jquery.ui.commonssuggester.js 
b/extensions/ValueView/lib/jquery.ui/jquery.ui.commonssuggester.js
index 89819a9..2720637 100644
--- a/extensions/ValueView/lib/jquery.ui/jquery.ui.commonssuggester.js
+++ b/extensions/ValueView/lib/jquery.ui/jquery.ui.commonssuggester.js
@@ -14,6 +14,14 @@
         * @constructor
         */
        $.widget( 'ui.commonssuggester', $.ui.suggester, {
+
+               /**
+                * @see jQuery.ui.suggester.options
+                */
+               options: {
+                       ajax: $.ajax
+               },
+
                /**
                 * @inheritdoc
                 * @protected
@@ -32,21 +40,23 @@
                 * @return {Function}
                 */
                _initDefaultSource: function() {
+                       var self = this;
+
                        return function( term ) {
                                var deferred = $.Deferred();
 
-                               $.ajax( {
+                               self.options.ajax( {
                                        url: 
'https://commons.wikimedia.org/w/api.php',
                                        dataType: 'jsonp',
                                        data: {
-                                               search: term,
+                                               search: 
self._grepFileTitleFromTerm( term ),
                                                action: 'opensearch',
                                                namespace: 6
                                        },
                                        timeout: 8000
                                } )
                                .done( function( response ) {
-                                       deferred.resolve( response[1], 
response[0] );
+                                       deferred.resolve( response[1], term );
                                } )
                                .fail( function( jqXHR, textStatus ) {
                                        // Since this is a JSONP request, this 
will always fail with a timeout...
@@ -58,6 +68,25 @@
                },
 
                /**
+                * @private
+                *
+                * @param {string} term
+                * @return {string}
+                */
+               _grepFileTitleFromTerm: function( term ) {
+                       try {
+                               // Make sure there are always at least 2 
characters left
+                               return decodeURIComponent( term
+                                       .replace( 
/^[^#]*\btitle=([^&#]{2,}).*/, '$1' )
+                                       .replace( /^[^#]*\/([^/?#]{2,}).*/, 
'$1' )
+                               );
+                       } catch ( ex ) {
+                               // Revert all replacements when the input was 
not a (fragment of a) valid URL
+                               return term;
+                       }
+               },
+
+               /**
                 * @inheritdoc
                 * @protected
                 */
diff --git a/extensions/ValueView/src/experts/GlobeCoordinateInput.js 
b/extensions/ValueView/src/experts/GlobeCoordinateInput.js
index 30682a6..d93facc 100644
--- a/extensions/ValueView/src/experts/GlobeCoordinateInput.js
+++ b/extensions/ValueView/src/experts/GlobeCoordinateInput.js
@@ -107,16 +107,24 @@
                                if ( !value ) {
                                        return value;
                                }
-                               value = value.getValue().getPrecision();
-                               if ( value === null ) {
-                                       return null;
+
+                               var precision = value.getValue().getPrecision();
+                               if ( !precision ) {
+                                       return {
+                                               custom: true,
+                                               value: null,
+                                               label: 
self._messageProvider.getMessage(
+                                                       
'valueview-expert-globecoordinateinput-nullprecision'
+                                               )
+                                       };
                                }
-                               return getPrecisionSetting( value ) || {
+
+                               return getPrecisionSetting( precision ) || {
                                        custom: true,
-                                       value: value,
+                                       value: precision,
                                        label: self._messageProvider.getMessage(
                                                
'valueview-expert-globecoordinateinput-customprecision',
-                                               [ Formatter.PRECISIONTEXT( 
value ) ]
+                                               [ Formatter.PRECISIONTEXT( 
precision ) ]
                                        )
                                };
                        }
diff --git a/extensions/ValueView/src/experts/resources.php 
b/extensions/ValueView/src/experts/resources.php
index d2c2183..792920d 100644
--- a/extensions/ValueView/src/experts/resources.php
+++ b/extensions/ValueView/src/experts/resources.php
@@ -67,6 +67,7 @@
                        ),
                        'messages' => array(
                                
'valueview-expert-globecoordinateinput-precision',
+                               
'valueview-expert-globecoordinateinput-nullprecision',
                                
'valueview-expert-globecoordinateinput-customprecision',
                        ),
                ),
diff --git a/extensions/ValueView/src/jquery.valueview.valueview.js 
b/extensions/ValueView/src/jquery.valueview.valueview.js
index dd4c66b..2c76592 100644
--- a/extensions/ValueView/src/jquery.valueview.valueview.js
+++ b/extensions/ValueView/src/jquery.valueview.valueview.js
@@ -336,7 +336,7 @@
         * before the edit mode has been started.
         */
        cancelEditing: function() {
-               return this.stopEditing( true );
+               this.stopEditing( true );
        },
 
        /**
diff --git 
a/extensions/ValueView/tests/lib/jquery.ui/jquery.ui.commonssuggester.tests.js 
b/extensions/ValueView/tests/lib/jquery.ui/jquery.ui.commonssuggester.tests.js
new file mode 100644
index 0000000..8dd7eba
--- /dev/null
+++ 
b/extensions/ValueView/tests/lib/jquery.ui/jquery.ui.commonssuggester.tests.js
@@ -0,0 +1,114 @@
+/**
+ * @license GPL-2.0+
+ * @author Thiemo Mättig
+ */
+( function( $, QUnit ) {
+       'use strict';
+
+       /**
+        * @param {Object} [options]
+        * @return {jQuery}
+        */
+       var newTestSuggester = function( options ) {
+               return $( '<input>' )
+                       .addClass( 'test_suggester' )
+                       .appendTo( 'body' )
+                       .commonssuggester( options );
+       };
+
+       QUnit.module( 'jquery.ui.commonssuggester', {
+               teardown: function() {
+                       var $suggester = $( '.test_suggester' ),
+                               suggester = $suggester.data( 'commonssuggester' 
);
+                       if ( suggester ) {
+                               suggester.destroy();
+                       }
+                       $suggester.remove();
+               }
+       } );
+
+       QUnit.test( 'Create', function( assert ) {
+               assert.expect( 1 );
+               var $suggester = newTestSuggester();
+
+               assert.ok(
+                       $suggester.data( 'commonssuggester' ) instanceof 
$.ui.commonssuggester,
+                       'Instantiated commons suggester.'
+               );
+       } );
+
+       QUnit.test( '_grepFileTitleFromTerm', function( assert ) {
+               var $suggester = newTestSuggester(),
+                       suggester = $suggester.data( 'commonssuggester' ),
+                       testCases = {
+                               '': '',
+                               'File:A.jpg': 'File:A.jpg',
+                               '%41': 'A',
+                               'A &%26 B.jpg#not-sure-if-URL': 'A && 
B.jpg#not-sure-if-URL',
+
+                               // Find last title=… parameter
+                               'title=A.jpg&title=B.jpg': 'B.jpg',
+                               'title=A.jpg/title=%42.jpg': 'B.jpg',
+                               'title=File%3AA.jpg&oldid=1#title=/X.jpg': 
'File:A.jpg',
+                               
'https://commons.wikimedia.org/w/?title=File:%41.jpg&action=edit': 'File:A.jpg',
+                               
'https://commons.wikimedia.org/w/index.php?title=File:A.jpg&oldid=1': 
'File:A.jpg',
+                               
'https://commons.wikimedia.org/w/index.php?title=File%3AA.jpg&diff=1': 
'File:A.jpg',
+
+                               // Find last word after a slash
+                               'title=A.jpg/B.jpg': 'B.jpg',
+                               'w/A.jpg': 'A.jpg',
+                               '/w/A.jpg': 'A.jpg',
+                               'A.jpg/B.jpg': 'B.jpg',
+                               'wiki/File:%41.jpg#title=/X.jpg': 'File:A.jpg',
+                               '/wiki/File:A.jpg': 'File:A.jpg',
+                               '//commons.wikimedia.org/wiki/File:A.jpg': 
'File:A.jpg',
+                               
'https://commons.wikimedia.org/wiki/File:A.jpg': 'File:A.jpg',
+                               
'https://commons.wikimedia.org/wiki/File:A.jpg#filehistory': 'File:A.jpg',
+                               
'https://commons.wikimedia.org/wiki/File:A.jpg?action=history': 'File:A.jpg',
+                               
'https://upload.wikimedia.org/wikipedia/commons/6/66/A.jpg': 'A.jpg',
+                               
'/wikipedia/commons/thumb/6/66/A.jpg/100px-A.jpg': '100px-A.jpg',
+
+                               // Minimum is 2 characters
+                               '/w/': '/w/',
+                               'title=A': 'title=A',
+                               'A.jpg/B': 'A.jpg/B',
+                               'A.jpg/B.jpg/C': 'B.jpg',
+
+                               // Do not do anything with invalid URL encoding
+                               '1%': '1%',
+                               'title=1%.jpg': 'title=1%.jpg'
+                       },
+                       numberOfTestCases = Object.keys( testCases ).length;
+
+               assert.expect( numberOfTestCases );
+
+               $.each( testCases, function( input, expected ) {
+                       var actual = suggester._grepFileTitleFromTerm( input );
+
+                       assert.strictEqual( actual, expected );
+               } );
+       } );
+
+       QUnit.test( 'search integration', function( assert ) {
+               assert.expect( 2 );
+               var $suggester = newTestSuggester( { ajax: function( options ) {
+                               var response = [ '', [] ];
+
+                               response[1]._requestTerm = options.data.search;
+
+                               return $.Deferred().resolve( response 
).promise();
+                       } } ),
+                       suggester = $suggester.data( 'commonssuggester' ),
+                       input = 'title=Foo/Bar',
+                       done = assert.async();
+
+               $suggester.val( input );
+               suggester.search().done( function( suggestions, term ) {
+                       assert.strictEqual( suggestions._requestTerm, 'Bar' );
+                       assert.strictEqual( term, input );
+
+                       done();
+               } );
+       } );
+
+}( jQuery, QUnit ) );
diff --git 
a/extensions/ValueView/tests/lib/jquery.ui/jquery.ui.suggester.tests.js 
b/extensions/ValueView/tests/lib/jquery.ui/jquery.ui.suggester.tests.js
index 7be3e36..51cf201 100644
--- a/extensions/ValueView/tests/lib/jquery.ui/jquery.ui.suggester.tests.js
+++ b/extensions/ValueView/tests/lib/jquery.ui/jquery.ui.suggester.tests.js
@@ -17,6 +17,7 @@
         * Factory creating a jQuery.ui.suggester widget suitable for testing.
         *
         * @param {Object} [options]
+        * @return {jQuery}
         */
        var newTestSuggester = function( options ) {
                options = $.extend( {
diff --git a/extensions/ValueView/tests/lib/resources.php 
b/extensions/ValueView/tests/lib/resources.php
index 4a07785..306dce0 100644
--- a/extensions/ValueView/tests/lib/resources.php
+++ b/extensions/ValueView/tests/lib/resources.php
@@ -84,6 +84,15 @@
                ),
 
 
+               'jquery.ui.commonssuggester.tests' => $moduleTemplate + array(
+                       'scripts' => array(
+                               'jquery.ui/jquery.ui.commonssuggester.tests.js',
+                       ),
+                       'dependencies' => array(
+                               'jquery.ui.commonssuggester',
+                       ),
+               ),
+
                'jquery.ui.inputextender.tests' => $moduleTemplate + array(
                        'scripts' => array(
                                'jquery.ui/jquery.ui.inputextender.tests.js',
diff --git a/extensions/Wikibase/client/i18n/vro.json 
b/extensions/Wikibase/client/i18n/vro.json
index b12557f..9a8af1c 100644
--- a/extensions/Wikibase/client/i18n/vro.json
+++ b/extensions/Wikibase/client/i18n/vro.json
@@ -14,5 +14,5 @@
        "wikibase-rc-hide-wikidata-show": "Näütäq",
        "wikibase-rc-wikibase-edit-letter": "A",
        "wikibase-rc-wikibase-edit-title": "Ütsüse {{WBREPONAME}} muutminõ",
-       "wikibase-otherprojects": "Teisin projekten"
+       "wikibase-otherprojects": "Tõisin projekten"
 }
diff --git a/extensions/Wikibase/client/i18n/zh-hant.json 
b/extensions/Wikibase/client/i18n/zh-hant.json
index fa2f2da..aa424bc 100644
--- a/extensions/Wikibase/client/i18n/zh-hant.json
+++ b/extensions/Wikibase/client/i18n/zh-hant.json
@@ -16,7 +16,8 @@
                        "MoonYaksha",
                        "EagerLin",
                        "一個正常人",
-                       "Cwek"
+                       "Cwek",
+                       "1233thehongkonger"
                ]
        },
        "wikibase-client-desc": "Wikibase 擴充套件客戶端",
@@ -73,6 +74,7 @@
        "wikibase-pageswithbadges-invalid-id": "“$1” 不是一個有效 ID 項目",
        "wikibase-pageswithbadges-badge": "徽章:",
        "wikibase-pageswithbadges-submit": "顯示頁面",
+       "wikibase-entityusage-invalid-id": "“$1” 不是一個有效的實體",
        "wikibase-pageinfo-entity-id": "{{WBREPONAME}} 項目 ID",
        "wikibase-pageinfo-entity-id-none": "無",
        "wikibase-property-render-error": "顯示屬性 $1:$2 失敗",
diff --git 
a/extensions/Wikibase/client/includes/Specials/SpecialEntityUsage.php 
b/extensions/Wikibase/client/includes/Specials/SpecialEntityUsage.php
index 0820dec..7451b5f 100644
--- a/extensions/Wikibase/client/includes/Specials/SpecialEntityUsage.php
+++ b/extensions/Wikibase/client/includes/Specials/SpecialEntityUsage.php
@@ -53,7 +53,8 @@
         * @param string $subPage
         */
        public function execute( $subPage ) {
-               $this->prepareParams( $subPage );
+               $entity = $this->getRequest()->getText( 'entity', $subPage );
+               $this->prepareParams( $entity );
 
                if ( $this->entityId !== null ) {
                        parent::execute( $subPage );
@@ -65,11 +66,9 @@
        }
 
        /**
-        * @param string $subPage
+        * @param string $entity
         */
-       private function prepareParams( $subPage ) {
-               $entity = $this->getRequest()->getText( 'entity', $subPage );
-
+       public function prepareParams( $entity ) {
                if ( $entity ) {
                        try {
                                $this->entityId = $this->idParser->parse( 
$entity );
@@ -128,9 +127,11 @@
        public function getQueryInfo() {
                $joinConds = [ 'wbc_entity_usage' => [ 'JOIN', [ 'page_id = 
eu_page_id' ] ] ];
                $conds = [ 'eu_entity_id' => 
$this->entityId->getSerialization() ];
-               $groupConcat = wfGetDB( DB_REPLICA )
-                       ->buildGroupConcatField( '|', 'wbc_entity_usage',
-                               'eu_aspect', $conds, $joinConds
+               $groupConcat = wfGetDB( DB_REPLICA )->buildGroupConcatField(
+                       '|',
+                       'wbc_entity_usage',
+                       'eu_aspect',
+                       [ 'eu_page_id = page_id' ] + $conds
                );
 
                return [
diff --git 
a/extensions/Wikibase/client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php
 
b/extensions/Wikibase/client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php
index e3daa05..794289e 100644
--- 
a/extensions/Wikibase/client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php
+++ 
b/extensions/Wikibase/client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php
@@ -6,7 +6,9 @@
 use RequestContext;
 use SpecialPageFactory;
 use SpecialPageTestBase;
+use Title;
 use Wikibase\Client\Specials\SpecialEntityUsage;
+use WikiPage;
 
 /**
  * @covers Wikibase\Client\Specials\SpecialEntityUsage
@@ -27,10 +29,18 @@
                                'value' => 11,
                                'namespace' => 0,
                                'title' => 'Tehran',
-                               'aspects' => 'S|O|L.fa',
+                               'aspects' => 'O|L.fa',
                                'eu_page_id' => 11,
                                'eu_entity_id' => 'Q3',
                        ],
+                       (object)[
+                               'value' => 22,
+                               'namespace' => 0,
+                               'title' => 'Athena',
+                               'aspects' => 'S',
+                               'eu_page_id' => 22,
+                               'eu_entity_id' => 'Q3',
+                       ]
                ];
 
                return new FakeResultWrapper( $rows );
@@ -53,18 +63,25 @@
 
        public function testExecuteWithValidParam() {
                list( $result, ) = $this->executeSpecialPage( 'Q3' );
-               $aspects = [
-                       wfMessage( 'wikibase-pageinfo-entity-usage-S' 
)->parse(),
+               $aspectsTehran = [
                        wfMessage( 'wikibase-pageinfo-entity-usage-O' 
)->parse(),
                        wfMessage( 'wikibase-pageinfo-entity-usage-L', 'fa' 
)->parse(),
                ];
-               $aspectList = 
RequestContext::getMain()->getLanguage()->commaList( $aspects );
+               $aspectsAthena = [
+                       wfMessage( 'wikibase-pageinfo-entity-usage-S' 
)->parse(),
+               ];
+
+               $lang = RequestContext::getMain()->getLanguage();
+               $aspectListTehran = $lang->commaList( $aspectsTehran );
+               $aspectListAthena = $lang->commaList( $aspectsAthena );
 
                $this->assertContains( 'Tehran', $result );
+               $this->assertContains( 'Athena', $result );
                $this->assertNotContains( '<p class="error"', $result );
                $expected = SpecialPageFactory::getLocalNameFor( 'EntityUsage', 
'Q3' );
                $this->assertContains( $expected, $result );
-               $this->assertContains( $aspectList, $result );
+               $this->assertContains( ': ' . $aspectListTehran . '</li>', 
$result );
+               $this->assertContains( ': ' . $aspectListAthena . '</li>', 
$result );
        }
 
        public function testExecuteWithInvalidParam() {
@@ -77,4 +94,101 @@
                );
        }
 
+       public function testReallyDoQuery() {
+               if ( wfGetDB( DB_REPLICA )->getType() === 'mysql' &&
+                       $this->usesTemporaryTables()
+               ) {
+                       $this->markTestSkipped( 'MySQL does not allow 
self-joins on temporary tables' );
+               }
+               $this->addReallyDoQueryData();
+
+               $special = new SpecialEntityUsage();
+               $special->prepareParams( 'Q3' );
+               $res = $special->reallyDoQuery( 50 );
+               $values = [];
+               $expectedUsages = [
+                       [ 'L.de' ],
+                       [ 'S', 'O' ],
+               ];
+
+               $i = 0;
+               foreach ( $res as $row ) {
+                       $values[] = [
+                               $row->value,
+                               $row->namespace,
+                               $row->title,
+                               $row->eu_page_id
+                       ];
+
+                       $this->assertUsageAspects( $expectedUsages[$i++], 
$row->aspects );
+               }
+
+               $expected = [
+                       [ '22', '0', 'Berlin', '22' ],
+                       [ '11', '0', 'Vienna', '11' ],
+               ];
+
+               $this->assertSame( $expected, $values );
+       }
+
+       private function assertUsageAspects( $expected, $aspectsString ) {
+               // The aspects are not ordered, so don't take this into account 
when asserting
+               $this->assertArrayEquals( $expected, explode( '|', 
$aspectsString ), false );
+       }
+
+       private function addReallyDoQueryData() {
+               $db = wfGetDB( DB_MASTER );
+               $dump = [
+                       'page' => [
+                               [
+                                       'page_title' => 'Vienna',
+                                       'page_namespace' => 0,
+                                       'page_id' => 11,
+                               ],
+                               [
+                                       'page_title' => 'Berlin',
+                                       'page_namespace' => 0,
+                                       'page_id' => 22,
+                               ],
+                       ],
+                       'wbc_entity_usage' => [
+                               [
+                                       'eu_page_id' => 11,
+                                       'eu_entity_id' => 'Q3',
+                                       'eu_aspect' => 'S'
+                               ],
+                               [
+                                       'eu_page_id' => 11,
+                                       'eu_entity_id' => 'Q3',
+                                       'eu_aspect' => 'O'
+                               ],
+                               [
+                                       'eu_page_id' => 11,
+                                       'eu_entity_id' => 'Q4',
+                                       'eu_aspect' => 'L.en'
+                               ],
+                               [
+                                       'eu_page_id' => 22,
+                                       'eu_entity_id' => 'Q3',
+                                       'eu_aspect' => 'L.de'
+                               ],
+                       ],
+               ];
+
+               foreach ( $dump as $table => $rows ) {
+                       // Clean everything
+                       $db->delete( $table, '*' );
+
+                       foreach ( $rows as $row ) {
+                               if ( $table === 'page' ) {
+                                       $title = Title::newFromText( 
$row['page_title'], $row['page_namespace'] );
+                                       $page = WikiPage::factory( $title );
+                                       $page->insertOn( $db, $row['page_id'] );
+                               } else {
+                                       $db->insert( $table, $row );
+                               }
+                       }
+               }
+       }
+
 }
diff --git a/extensions/Wikibase/composer.json 
b/extensions/Wikibase/composer.json
index 41cea68..d26fea1 100644
--- a/extensions/Wikibase/composer.json
+++ b/extensions/Wikibase/composer.json
@@ -32,7 +32,7 @@
                "data-values/data-types": "~0.5.0",
                "data-values/serialization": "~1.1",
                "data-values/javascript": "~0.8.0",
-               "data-values/value-view": "~0.17.3",
+               "data-values/value-view": "~0.18.0",
                "wikibase/data-model": "~6.1",
                "wikibase/data-model-serialization": "~2.2",
                "wikibase/internal-serialization": "~2.3",
diff --git 
a/extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php 
b/extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php
index 0fe4b65..337f5b1 100644
--- a/extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php
+++ b/extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php
@@ -351,8 +351,8 @@
                        'term_entity_id' => $entityIds,
                );
 
-               if ( $termTypes ) {
-                       $where['term_type'] = $termTypes;
+               if ( $termTypes === null ) {
+                       $termTypes = [ null ];
                }
 
                if ( $languages ) {
@@ -361,14 +361,17 @@
 
                $dbw = $this->getConnection( DB_SLAVE );
 
-               $res = $dbw->select(
-                       $this->termTable,
-                       array( 'term_entity_type', 'term_entity_id', 
'term_type', 'term_language', 'term_text' ),
-                       $where,
-                       __METHOD__
-               );
+               // Do one query per term type here, this is way faster on 
MySQL: T147748
+               foreach ( $termTypes as $termType ) {
+                       $res = $dbw->select(
+                               $this->termTable,
+                               array( 'term_entity_type', 'term_entity_id', 
'term_type', 'term_language', 'term_text' ),
+                               array_merge( $where, $termType !== null ? [ 
'term_type' => $termType ] : [] ),
+                               __METHOD__
+                       );
 
-               $this->injectTerms( $res );
+                       $this->injectTerms( $res );
+               }
 
                $this->releaseConnection( $dbw );
        }
diff --git 
a/extensions/Wikibase/lib/tests/phpunit/Store/EntityInfoBuilderTest.php 
b/extensions/Wikibase/lib/tests/phpunit/Store/EntityInfoBuilderTest.php
index 8b3730a..c3c59da 100644
--- a/extensions/Wikibase/lib/tests/phpunit/Store/EntityInfoBuilderTest.php
+++ b/extensions/Wikibase/lib/tests/phpunit/Store/EntityInfoBuilderTest.php
@@ -189,14 +189,14 @@
 
        public function collectTermsProvider() {
                return array(
-                       array(
+                       'empty set' => array(
                                array(),
                                null,
                                null,
                                array()
                        ),
 
-                       array(
+                       'all term types' => array(
                                array(
                                        new ItemId( 'Q1' ),
                                        new PropertyId( 'P3' ),
@@ -229,7 +229,7 @@
                                )
                        ),
 
-                       array(
+                       'one term type' => array(
                                array(
                                        new ItemId( 'Q1' ),
                                        new PropertyId( 'P3' ),
@@ -247,6 +247,34 @@
                                        'Q7' => array( 'id' => 'Q7', 'type' => 
Item::ENTITY_TYPE, 'labels' => array() ),
                                )
                        ),
+
+                       'two term types' => array(
+                               array(
+                                       new ItemId( 'Q1' ),
+                                       new PropertyId( 'P3' ),
+                                       new ItemId( 'Q7' ),
+                               ),
+                               array( 'label', 'description' ),
+                               null,
+                               array(
+                                       'Q1' => array( 'id' => 'Q1', 'type' => 
Item::ENTITY_TYPE,
+                                               'labels' => 
$this->makeLanguageValueRecords( array(
+                                                       'en' => 'label:Q1/en', 
'de' => 'label:Q1/de' ) ),
+                                               'descriptions' => 
$this->makeLanguageValueRecords( array(
+                                                       'en' => 
'description:Q1/en', 'de' => 'description:Q1/de' ) )
+                                       ),
+                                       'P3' => array( 'id' => 'P3', 'type' => 
Property::ENTITY_TYPE,
+                                               'labels' => 
$this->makeLanguageValueRecords( array(
+                                                       'en' => 'label:P3/en', 
'de' => 'label:P3/de' ) ),
+                                               'descriptions' => 
$this->makeLanguageValueRecords( array(
+                                                       'en' => 
'description:P3/en', 'de' => 'description:P3/de' ) )
+                                       ),
+                                       'Q7' => array( 'id' => 'Q7', 'type' => 
Item::ENTITY_TYPE,
+                                               'labels' => array(),
+                                               'descriptions' => array()
+                                       ),
+                               )
+                       ),
                );
        }
 
diff --git a/extensions/Wikibase/repo/i18n/de.json 
b/extensions/Wikibase/repo/i18n/de.json
index b20d78c..5762a17 100644
--- a/extensions/Wikibase/repo/i18n/de.json
+++ b/extensions/Wikibase/repo/i18n/de.json
@@ -104,7 +104,9 @@
        "wikibase-claimview-snak-tooltip": "Gib einen Wert ein, der der 
Eigenschaft namens „$1“ entspricht. Falls die Eigenschaft keinen bestimmten 
Wert hat oder der derzeitige Wert unbekannt ist, kannst du einen alternativen 
Werttyp wählen, indem du auf das Symbol vor dem Eingabekasten klickst.",
        "wikibase-claimview-snak-new-tooltip": "Nach der Festlegung einer 
Eigenschaft kannst du einen dazugehörigen Wert eingeben. Falls die Eigenschaft 
keinen bestimmten Wert hat oder der derzeitige Wert unbekannt ist, kannst du 
einen alternativen Werttyp wählen, indem du auf das Symbol vor dem 
Eingabekasten klickst.",
        "wikibase-statementview-rank-preferred": "Bevorzugter Rang",
+       "wikibase-statementview-rank-tooltip-preferred": "Gültiger und 
aktueller Wert",
        "wikibase-statementview-rank-normal": "Normaler Rang",
+       "wikibase-statementview-rank-tooltip-normal": "Gültiger Wert, jedoch 
vermutlich historisch",
        "wikibase-statementview-rank-deprecated": "Missbilligter Rang",
        "wikibase-statementview-references-counter": 
"$1{{PLURAL:$2|0=|$3+$2$4}} {{PLURAL:$1|Fundstelle|Fundstellen}}",
        "wikibase-statementview-referencesheading-pendingcountertooltip": 
"{{PLURAL:$1|Ein Beleg wurde|$1 Belege wurden}} noch nicht gespeichert",
diff --git a/extensions/Wikibase/repo/i18n/en.json 
b/extensions/Wikibase/repo/i18n/en.json
index ffc0e8f..177580b 100644
--- a/extensions/Wikibase/repo/i18n/en.json
+++ b/extensions/Wikibase/repo/i18n/en.json
@@ -91,8 +91,11 @@
        "wikibase-claimview-snak-tooltip": "Enter a value corresponding to the 
property named \"$1\". If the property has no designated value or the actual 
value is not known, you can choose an alternative value type by clicking the 
icon before the input box.",
        "wikibase-claimview-snak-new-tooltip": "After specifying a property you 
can enter a corresponding value. If the property has no designated value or the 
actual value is not known, you can choose an alternative value type by clicking 
the icon before the input box.",
        "wikibase-statementview-rank-preferred": "Preferred rank",
+       "wikibase-statementview-rank-tooltip-preferred": "Valid and up-to-date 
value",
        "wikibase-statementview-rank-normal": "Normal rank",
+       "wikibase-statementview-rank-tooltip-normal": "Valid value, though 
possibly historic",
        "wikibase-statementview-rank-deprecated": "Deprecated rank",
+       "wikibase-statementview-rank-tooltip-deprecated": "Value is known to be 
wrong but (used to be) commonly believed",
        "wikibase-statementview-references-counter": 
"$1{{PLURAL:$2|0=|$3+$2$4}} {{PLURAL:$1|reference|references}}",
        "wikibase-statementview-referencesheading-pendingcountertooltip": 
"{{PLURAL:$1|One reference|$1 references}} not saved yet",
        "wikibase-snakview-property-input-placeholder": "property",
diff --git a/extensions/Wikibase/repo/i18n/pt.json 
b/extensions/Wikibase/repo/i18n/pt.json
index 860b1cd..d54046e 100644
--- a/extensions/Wikibase/repo/i18n/pt.json
+++ b/extensions/Wikibase/repo/i18n/pt.json
@@ -207,7 +207,7 @@
        "wikibase-itemmerge-cant-load-entity-content": "Falha ao carregar o 
item.",
        "wikibase-itemmerge-cant-merge-self": "Não é possível fundir um item 
com ele mesmo.",
        "special-dispatchstats": "Estatísticas de envio de alterações",
-       "wikibase-dispatchstats-no-stats": "Não existem estatísticas 
disponíveis actualmente.",
+       "wikibase-dispatchstats-no-stats": "Não existem estatísticas 
disponíveis atualmente.",
        "wikibase-dispatchstats-change-id": "ID",
        "wikibase-dispatchstats-change-timestamp": "Data e hora",
        "wikibase-dispatchstats-oldest-change": "Mais antigo",
@@ -250,7 +250,7 @@
        "wikibase-redirectentity-submit": "Redirecionar",
        "wikibase-api-unresolved-redirect": "O identificador (ID) fornecido 
refere-se a um redirecionamento, o que não é suportado neste contexto.",
        "wikibase-api-no-such-sitelink": "Não foi possível encontrar uma 
ligação de sítio para '$1' ao tentar editar os emblemas.",
-       "wikibase-conflict-patched": "A sua edição foi actualizada para a 
versão mais recente.",
+       "wikibase-conflict-patched": "A sua edição foi adicionada à versão mais 
recente.",
        "wikibase-restoreold": "restaurar",
        "wikibase-entity-summary-restore": "Restaurar revisão $3 por 
[[Special:Contributions/$4|{{GENDER:$4|$4}}]]",
        "wikibase-noentity": "Este conjunto de dados não existe. 
Pode\n[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} pesquisar os 
registos relacionados]\npara descobrir o que lhe sucedeu.",
diff --git a/extensions/Wikibase/repo/i18n/qqq.json 
b/extensions/Wikibase/repo/i18n/qqq.json
index 1493122..2e4151b 100644
--- a/extensions/Wikibase/repo/i18n/qqq.json
+++ b/extensions/Wikibase/repo/i18n/qqq.json
@@ -122,8 +122,11 @@
        "wikibase-claimview-snak-tooltip": "Tooltip message displayed when 
hovering/clicking the help icon next to the save, cancel and remove links of a 
claim (see [[d:Wikidata:Glossary#Claim]]).\n\nParameters:\n* $1 - the property 
name the user is about to edit a value of or add another value to",
        "wikibase-claimview-snak-new-tooltip": "Tooltip message displayed when 
hovering/clicking the help icon next to the save, cancel and remove links of a 
claim (see [[d:Wikidata:Glossary]]) when about to add a completely new claim 
which includes specifying the property.",
        "wikibase-statementview-rank-preferred": "Label of the 
[[d:Wikidata:Glossary#Rank-preferred|Preferred Rank]] item within the menu that 
allows adjusting a [[d:Wikidata:Glossary#Statement|Statement's]] 
[[d:Wikidata:Glossary#Rank|Rank]]. The message is additionally used as tooltip 
on the rank icon when the statement has assigned the Preferred rank.",
+       "wikibase-statementview-rank-tooltip-preferred": "Tooltip of the 
[[d:Wikidata:Glossary#Rank-preferred|Preferred Rank]] item within the menu that 
allows adjusting a [[d:Wikidata:Glossary#Statement|Statement's]] 
[[d:Wikidata:Glossary#Rank|Rank]].",
        "wikibase-statementview-rank-normal": "Label of the 
[[d:Wikidata:Glossary#Rank-normal|Normal Rank]] item within the menu that 
allows adjusting a [[d:Wikidata:Glossary#Statement|Statement's]] 
[[d:Wikidata:Glossary#Rank|Rank]]. The message is additionally used as tooltip 
on the rank icon when the statement has assigned the Normal Rank.",
+       "wikibase-statementview-rank-tooltip-normal": "Tooltip of the 
[[d:Wikidata:Glossary#Rank-normal|Normal Rank]] item within the menu that 
allows adjusting a [[d:Wikidata:Glossary#Statement|Statement's]] 
[[d:Wikidata:Glossary#Rank|Rank]].",
        "wikibase-statementview-rank-deprecated": "Label of the 
[[d:Wikidata:Glossary#Rank-deprecated|Deprecated Rank]] item within the menu 
that allows adjusting a [[d:Wikidata:Glossary#Statement|Statement's]] 
[[d:Wikidata:Glossary#Rank|Rank]]. The message is additionally used as tooltip 
on the rank icon when the statement has assigned the Deprecated Rank.",
+       "wikibase-statementview-rank-tooltip-deprecated": "Tooltip of the 
[[d:Wikidata:Glossary#Rank-deprecated|Deprecated Rank]] item within the menu 
that allows adjusting a [[d:Wikidata:Glossary#Statement|Statement's]] 
[[d:Wikidata:Glossary#Rank|Rank]].",
        "wikibase-statementview-references-counter": "Used in the heading for 
the references associated with a statement (see [[d:Wikidata:Glossary]]). The 
heading is giving information about how many references exist for that 
statement. This is the whole heading. The number of unsaved references should 
only be displayed if it's not zero. In that case, it is wrapped by $3 and $4 to 
add an HTML tooltip.\n\nParameters:\n* $1 - the number of saved references\n* 
$2 - the number of unsaved references\n* $3 - placeholder for HTML wrapping the 
number of unsaved references, if displayed (beginning)\n* $4 - placeholder for 
HTML wrapping the number of unsaved references, if displayed 
(end)\n{{Identical|Reference}}",
        "wikibase-statementview-referencesheading-pendingcountertooltip": 
"Tooltip displayed in the references heading when there are references (see 
[[d:Wikidata:Glossary]]) in edit mode which are not saved 
yet.\n\nParameters:\n* $1 - the number of elements not saved yet",
        "wikibase-snakview-property-input-placeholder": "Placeholder message 
that is initially displayed within the property input element when adding a new 
snak. See also [[d:Wikidata:Glossary]].\n{{Identical|Property}}",
diff --git a/extensions/Wikibase/repo/includes/Actions/SubmitEntityAction.php 
b/extensions/Wikibase/repo/includes/Actions/SubmitEntityAction.php
index 8109d3e..8f17de2 100644
--- a/extensions/Wikibase/repo/includes/Actions/SubmitEntityAction.php
+++ b/extensions/Wikibase/repo/includes/Actions/SubmitEntityAction.php
@@ -101,21 +101,20 @@
                $latestContent = $latestRevision->getContent();
 
                $diff = $newerContent->getDiff( $olderContent );
+               $patchedContent = $latestContent->getPatchedCopy( $diff );
 
                $summary = $request->getText( 'wpSummary' );
                $editToken = $request->getText( 'wpEditToken' );
 
-               if ( $newerRevision->getId() === $latestRevision->getId() ) { 
// restore
-                       if ( $diff->isEmpty() ) {
+               if ( $request->getCheck( 'restore' ) ) { // restore
+                       if ( $patchedContent->equals( $latestContent ) ) {
                                $status = Status::newGood();
                                $status->warning( 'wikibase-empty-undo' );
                        } else {
                                $summary = $this->makeRestoreSummary( 
$olderRevision, $summary );
-                               $status = $this->attemptSave( $title, 
$olderContent, $summary, $editToken );
+                               $status = $this->attemptSave( $title, 
$patchedContent, $summary, $editToken );
                        }
                } else { // undo
-                       $patchedContent = $latestContent->getPatchedCopy( $diff 
);
-
                        if ( $patchedContent->equals( $latestContent ) ) {
                                $status = Status::newGood();
                                $status->warning( 'wikibase-empty-undo' );
diff --git 
a/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementview.RankSelector.js
 
b/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementview.RankSelector.js
index 79cb7a0..29ab036 100644
--- 
a/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementview.RankSelector.js
+++ 
b/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementview.RankSelector.js
@@ -208,6 +208,7 @@
                                        .append(
                                                $( '<a/>' )
                                                .text( mw.msg( 
'wikibase-statementview-rank-' + rankName ) )
+                                               .attr( 'title', mw.msg( 
'wikibase-statementview-rank-tooltip-' + rankName ) )
                                                .on( 'click.' + 
self.widgetName, function( event ) {
                                                        event.preventDefault();
                                                } )
diff --git a/extensions/Wikibase/view/resources/jquery/wikibase/resources.php 
b/extensions/Wikibase/view/resources/jquery/wikibase/resources.php
index d3c1a46..2c70db8 100644
--- a/extensions/Wikibase/view/resources/jquery/wikibase/resources.php
+++ b/extensions/Wikibase/view/resources/jquery/wikibase/resources.php
@@ -418,8 +418,11 @@
                                'wikibase-claimview-snak-tooltip',
                                'wikibase-claimview-snak-new-tooltip',
                                'wikibase-statementview-rank-preferred',
+                               'wikibase-statementview-rank-tooltip-preferred',
                                'wikibase-statementview-rank-normal',
+                               'wikibase-statementview-rank-tooltip-normal',
                                'wikibase-statementview-rank-deprecated',
+                               
'wikibase-statementview-rank-tooltip-deprecated',
                                'wikibase-statementview-references-counter',
                                
'wikibase-statementview-referencesheading-pendingcountertooltip',
                        ),
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 82ca641..a33874a 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -880,17 +880,17 @@
     },
     {
         "name": "data-values/value-view",
-        "version": "0.17.4",
-        "version_normalized": "0.17.4.0",
+        "version": "0.18.0",
+        "version_normalized": "0.18.0.0",
         "source": {
             "type": "git",
             "url": "https://github.com/wikimedia/data-values-value-view.git";,
-            "reference": "094a35216990d62daf104037edd3d593d406d80d"
+            "reference": "5938027bbbad63e54cfa0266db211bac5fa902b2"
         },
         "dist": {
             "type": "zip",
-            "url": 
"https://api.github.com/repos/wikimedia/data-values-value-view/zipball/094a35216990d62daf104037edd3d593d406d80d";,
-            "reference": "094a35216990d62daf104037edd3d593d406d80d",
+            "url": 
"https://api.github.com/repos/wikimedia/data-values-value-view/zipball/5938027bbbad63e54cfa0266db211bac5fa902b2";,
+            "reference": "5938027bbbad63e54cfa0266db211bac5fa902b2",
             "shasum": ""
         },
         "require": {
@@ -901,7 +901,7 @@
             "jakub-onderka/php-parallel-lint": "0.9",
             "mediawiki/mediawiki-codesniffer": "0.4.0"
         },
-        "time": "2016-10-05 14:27:34",
+        "time": "2016-10-14 12:19:21",
         "type": "mediawiki-extension",
         "extra": {
             "branch-alias": {
@@ -1348,12 +1348,12 @@
         "source": {
             "type": "git",
             "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-            "reference": "7f7a926567984089c1c157da35f19260d18bd7c9"
+            "reference": "925de4a0469c5fe4727eba81704ce67833f8e78c"
         },
         "dist": {
             "type": "zip",
-            "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/7f7a926567984089c1c157da35f19260d18bd7c9";,
-            "reference": "7f7a926567984089c1c157da35f19260d18bd7c9",
+            "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/925de4a0469c5fe4727eba81704ce67833f8e78c";,
+            "reference": "925de4a0469c5fe4727eba81704ce67833f8e78c",
             "shasum": ""
         },
         "require": {
@@ -1367,7 +1367,7 @@
             "data-values/serialization": "~1.1",
             "data-values/time": "~0.8.4",
             "data-values/validators": "~0.1.0",
-            "data-values/value-view": "~0.17.3",
+            "data-values/value-view": "~0.18.0",
             "diff/diff": "~2.0",
             "php": ">=5.5.0",
             "wikibase/data-model": "~6.1",
@@ -1386,7 +1386,7 @@
             "jakub-onderka/php-parallel-lint": "0.9.2",
             "mediawiki/mediawiki-codesniffer": "0.4.0|0.5.0"
         },
-        "time": "2016-10-13 08:27:02",
+        "time": "2016-10-14 15:29:48",
         "type": "mediawiki-extension",
         "installation-source": "dist",
         "autoload": {

-- 
To view, visit https://gerrit.wikimedia.org/r/316058
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie15c031c6eb74ccf5db80dc8493fd807906a8049
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikidata
Gerrit-Branch: master
Gerrit-Owner: WikidataBuilder <wikidata-servi...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to