WikidataBuilder has uploaded a new change for review.
https://gerrit.wikimedia.org/r/119728
Change subject: New Wikidata Build - 20/03/2014 10:00
......................................................................
New Wikidata Build - 20/03/2014 10:00
Change-Id: I8dc465205ea21839349ff9b6e7424d2b963f99b8
---
M composer.lock
M extensions/Wikibase/client/WikibaseClient.i18n.php
M extensions/Wikibase/client/includes/LangLinkHandler.php
M extensions/Wikibase/lib/includes/EntityFactory.php
M extensions/Wikibase/lib/includes/Term.php
M extensions/Wikibase/lib/includes/Utils.php
M extensions/Wikibase/lib/includes/serializers/EntitySerializer.php
M
extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
M extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimview.js
M
extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js
M
extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
M extensions/Wikibase/lib/resources/templates.php
M extensions/Wikibase/lib/resources/wikibase.utilities/wikibase.utilities.ui.js
M
extensions/Wikibase/lib/tests/qunit/jquery.wikibase/jquery.wikibase.claimview.tests.js
M extensions/Wikibase/repo/Wikibase.i18n.php
M extensions/Wikibase/repo/includes/ClaimHtmlGenerator.php
M extensions/Wikibase/repo/includes/api/MergeItems.php
M extensions/Wikibase/repo/includes/api/ResultBuilder.php
M extensions/Wikibase/repo/includes/content/EntityHandler.php
M vendor/autoload.php
M vendor/composer/autoload_real.php
M vendor/composer/installed.json
22 files changed, 150 insertions(+), 119 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata
refs/changes/28/119728/1
diff --git a/composer.lock b/composer.lock
index a987f80..91d2e6e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -850,12 +850,12 @@
"source": {
"type": "git",
"url":
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git",
- "reference": "0fab576bdf933b0d91953238c0ed66836661efb1"
+ "reference": "27bb6998e96887a346f62faad91494e872e4d48e"
},
"dist": {
"type": "zip",
- "url":
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/0fab576bdf933b0d91953238c0ed66836661efb1",
- "reference": "0fab576bdf933b0d91953238c0ed66836661efb1",
+ "url":
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/27bb6998e96887a346f62faad91494e872e4d48e",
+ "reference": "27bb6998e96887a346f62faad91494e872e4d48e",
"shasum": ""
},
"require": {
@@ -914,7 +914,7 @@
"wikibaserepo",
"wikidata"
],
- "time": "2014-03-18 21:02:54"
+ "time": "2014-03-20 09:43:11"
}
],
"packages-dev": [
diff --git a/extensions/Wikibase/client/WikibaseClient.i18n.php
b/extensions/Wikibase/client/WikibaseClient.i18n.php
index 31a5ee0..1712095 100644
--- a/extensions/Wikibase/client/WikibaseClient.i18n.php
+++ b/extensions/Wikibase/client/WikibaseClient.i18n.php
@@ -1863,6 +1863,7 @@
* @author ExampleTomer
* @author Guycn1
* @author Guycn2
+ * @author Inkbug
* @author ערן
*/
$messages['he'] = array(
@@ -1901,7 +1902,7 @@
'wikibase-property-notfound' => 'המאפיין $1 לא נמצא.',
'wikibase-property-notsupportedyet' => 'ההרחבה ויקיביסס עדיין לא תומכת
בסוג המאפיין של המאפיין $1.',
'wikibase-rc-hide-wikidata' => '$1 {{WBREPONAME}}',
- 'wikibase-rc-hide-wikidata-hide' => 'הסתרה',
+ 'wikibase-rc-hide-wikidata-hide' => 'הסתרת',
'wikibase-rc-hide-wikidata-show' => 'הצגה',
'wikibase-rc-show-wikidata-pref' => 'הצגת עריכות {{WBREPONAME}}
בשינויים אחרונים',
'wikibase-rc-wikibase-edit-letter' => 'נ',
@@ -3903,6 +3904,7 @@
'wikibase-pageinfo-entity-id' => 'Идентификатор элемента в
{{grammar:genitive|{{WBREPONAME}}}}',
'wikibase-pageinfo-entity-id-none' => 'отсутствует',
'wikibase-property-render-error' => 'Ошибка раскрытия свойства «$1»:
$2',
+ 'wikibase-otherprojects' => 'Другие проекты',
);
/** Sicilian (sicilianu)
@@ -4497,6 +4499,7 @@
'wikibase-pageinfo-entity-id' => 'Ідентифікатор елемента у
{{WBREPONAME}}',
'wikibase-pageinfo-entity-id-none' => 'Нема',
'wikibase-property-render-error' => 'Не вдалося відобразити властивість
$1: $2',
+ 'wikibase-otherprojects' => 'Інші проекти',
);
/** Urdu (اردو)
diff --git a/extensions/Wikibase/client/includes/LangLinkHandler.php
b/extensions/Wikibase/client/includes/LangLinkHandler.php
index 1a60058..7dd5c2a 100644
--- a/extensions/Wikibase/client/includes/LangLinkHandler.php
+++ b/extensions/Wikibase/client/includes/LangLinkHandler.php
@@ -46,11 +46,6 @@
protected $sites;
/**
- * @var Site[]
- */
- private $sitesByNavigationId = null;
-
- /**
* @var string
*/
private $siteGroup;
@@ -84,7 +79,8 @@
*/
public function getEntityLinks( Title $title ) {
wfProfileIn( __METHOD__ );
- wfDebugLog( __CLASS__, __FUNCTION__ . ": Looking for sitelinks
defined by the corresponding item on the wikibase repo." );
+ wfDebugLog( __CLASS__, __FUNCTION__ . ": Looking for sitelinks
defined by the '
+ . 'corresponding item on the wikibase repo." );
$links = array();
@@ -92,10 +88,13 @@
$itemId = $this->siteLinkLookup->getEntityIdForSiteLink(
$siteLink );
if ( $itemId !== null ) {
- wfDebugLog( __CLASS__, __FUNCTION__ . ": Item ID for "
. $title->getFullText() . " is " . $itemId->getPrefixedId() );
+ wfDebugLog( __CLASS__, __FUNCTION__ . ": Item ID for "
. $title->getFullText()
+ . " is " . $itemId->getPrefixedId() );
+
$links = $this->siteLinkLookup->getSiteLinksForItem(
$itemId );
} else {
- wfDebugLog( __CLASS__, __FUNCTION__ . ": No
corresponding item found for " . $title->getFullText() );
+ wfDebugLog( __CLASS__, __FUNCTION__ . ": No
corresponding item found for "
+ . $title->getFullText() );
}
wfDebugLog( __CLASS__, __FUNCTION__ . ": Found " . count(
$links ) . " links." );
@@ -206,7 +205,9 @@
}
if ( !in_array( $site->getGroup(), $allowedGroups ) ) {
- wfDebugLog( __CLASS__, __FUNCTION__ . ':
skipping link to other group: ' . $wiki . ' belongs to ' . $site->getGroup() );
+ wfDebugLog( __CLASS__, __FUNCTION__ . ':
skipping link to other group: ' . $wiki
+ . ' belongs to ' . $site->getGroup() );
+
unset( $repoLinks[$wiki] );
continue;
}
@@ -435,7 +436,11 @@
public function updateItemIdProperty( Title $title, ParserOutput $out )
{
wfProfileIn( __METHOD__ );
- $entityIdPropertyUpdater = new EntityIdPropertyUpdater(
$this->siteLinkLookup, $this->siteId );
+ $entityIdPropertyUpdater = new EntityIdPropertyUpdater(
+ $this->siteLinkLookup,
+ $this->siteId
+ );
+
$entityIdPropertyUpdater->updateItemIdProperty( $out, $title );
wfProfileOut( __METHOD__ );
diff --git a/extensions/Wikibase/lib/includes/EntityFactory.php
b/extensions/Wikibase/lib/includes/EntityFactory.php
index d7cd986..f88c6f4 100644
--- a/extensions/Wikibase/lib/includes/EntityFactory.php
+++ b/extensions/Wikibase/lib/includes/EntityFactory.php
@@ -1,6 +1,8 @@
<?php
namespace Wikibase;
+
+use MWContentSerializationException;
use MWException;
/**
@@ -115,7 +117,7 @@
* @since 0.3
*
* @throws MWException if the given entity type or serialization format
is not known.
- * @throws \MWContentSerializationException if the given blob was
malformed.
+ * @throws MWContentSerializationException if the given blob was
malformed.
*
* @return Entity The new Entity object.
*/
@@ -138,7 +140,7 @@
* @return array The deserialized data structure
*
* @throws MWException if an unsupported format is requested
- * @throws \MWContentSerializationException If serialization fails.
+ * @throws MWContentSerializationException If serialization fails.
*/
public function unserializedData( $blob, $format = null ) {
if ( is_null( $format ) ) {
@@ -153,12 +155,12 @@
$data = json_decode( $blob, true ); //FIXME:
suppress notice on failed serialization!
break;
default:
- throw new MWException( "serialization format
$format is not supported for Wikibase content model" );
- break;
+ throw new MWException( "serialization format
$format is not supported for '
+ . 'Wikibase content model" );
}
if ( $data === false || $data === null ) {
- throw new \MWContentSerializationException( 'failed to
deserialize' );
+ throw new MWContentSerializationException( 'failed to
deserialize' );
}
if ( is_object( $data ) ) {
@@ -167,7 +169,7 @@
}
if ( !is_array( $data ) ) {
- throw new \MWContentSerializationException( 'failed to
deserialize: not an array.' );
+ throw new MWContentSerializationException( 'failed to
deserialize: not an array.' );
}
return $data;
diff --git a/extensions/Wikibase/lib/includes/Term.php
b/extensions/Wikibase/lib/includes/Term.php
index 970116b..e4b01a2 100644
--- a/extensions/Wikibase/lib/includes/Term.php
+++ b/extensions/Wikibase/lib/includes/Term.php
@@ -67,7 +67,6 @@
break;
default:
throw new MWException( 'Invalid term
field provided' );
- break;
}
}
}
diff --git a/extensions/Wikibase/lib/includes/Utils.php
b/extensions/Wikibase/lib/includes/Utils.php
index c5e39b9..3982d57 100644
--- a/extensions/Wikibase/lib/includes/Utils.php
+++ b/extensions/Wikibase/lib/includes/Utils.php
@@ -234,7 +234,7 @@
// XXX: there's a race condition here.
if ( file_exists( $pidfile ) ) {
$pid = file_get_contents( $pidfile );
- if ( Utils::isPidAlive( $pid ) === true ) {
+ if ( self::isPidAlive( $pid ) === true ) {
return false;
}
}
diff --git a/extensions/Wikibase/lib/includes/serializers/EntitySerializer.php
b/extensions/Wikibase/lib/includes/serializers/EntitySerializer.php
index f71a915..030a2a5 100644
--- a/extensions/Wikibase/lib/includes/serializers/EntitySerializer.php
+++ b/extensions/Wikibase/lib/includes/serializers/EntitySerializer.php
@@ -126,7 +126,7 @@
$serialization['type'] = $entity->getType();
- $parts = $this->options->getOption(
EntitySerializer::OPT_PARTS, array() );
+ $parts = $this->options->getOption( self::OPT_PARTS, array() );
foreach ( $parts as $key ) {
switch ( $key ) {
diff --git
a/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
b/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
index 3b9d0e3..37889b7 100644
---
a/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
+++
b/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
@@ -210,7 +210,7 @@
// Default: Create a link to the property to be
used as group title.
$title = wb.utilities.ui.buildLinkToEntityPage(
property.getContent(),
- property.getTitle().getUrl()
+ property.getTitle()
);
} else {
// The claims group features a property that
has been deleted.
diff --git
a/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimview.js
b/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimview.js
index 2b811a7..752ff79 100644
---
a/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimview.js
+++
b/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimview.js
@@ -73,10 +73,9 @@
options: {
template: 'wb-claim',
templateParams: [
- function() { // class='wb-claim-$2'
+ function() { // class='wb-claim-$1'
return ( this._claim && this._claim.getGuid() )
|| 'new';
},
- 'wb-last', // class: wb-first|wb-last
'', // .wb-claim-mainsnak
'' // Qualifiers
],
diff --git
a/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js
b/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js
index db7e3fa..baae07c 100644
---
a/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js
+++
b/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js
@@ -729,7 +729,7 @@
if( this.options.locked.property || !this.isInEditMode() ) {
// property set and can't be changed afterwards, only
display label
$propertyDom = property
- ? wb.utilities.ui.buildLinkToEntityPage(
property, title.getUrl() )
+ ? wb.utilities.ui.buildLinkToEntityPage(
property, title )
// shouldn't usually happen, only in non-edit
mode, while no Snak is set:
: wb.utilities.ui.buildMissingEntityInfo(
propertyId, wb.Property );
} else {
diff --git
a/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
b/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
index ed45f86..1dc831a 100644
---
a/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
+++
b/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
@@ -24,7 +24,6 @@
options: {
template: 'wb-statement',
templateParams: [
- 'wb-last', // class: wb-first|wb-last
'', // Rank selector
function() { // class='wb-claim-$2'
return ( this._claim && this._claim.getGuid() )
|| 'new';
diff --git a/extensions/Wikibase/lib/resources/templates.php
b/extensions/Wikibase/lib/resources/templates.php
index 655ac33..a26b8b5 100644
--- a/extensions/Wikibase/lib/resources/templates.php
+++ b/extensions/Wikibase/lib/resources/templates.php
@@ -94,11 +94,11 @@
$templates['wb-claim'] =
<<<HTML
-<div class="wb-claim wb-claim-$1 $2">
+<div class="wb-claim wb-claim-$1">
<div class="wb-claim-mainsnak" dir="auto">
- $3 <!-- wb-snak (Main Snak) -->
+ $2 <!-- wb-snak (Main Snak) -->
</div>
- <div class="wb-claim-qualifiers">$4</div>
+ <div class="wb-claim-qualifiers">$3</div>
</div>
HTML;
@@ -121,18 +121,18 @@
// the non-JS toolbar to attach to. This parameter should be removed.
$templates['wb-statement'] =
<<<HTML
-<div class="wb-statement wb-statementview $1">
- <div class="wb-statement-rank">$2</div>
- <div class="wb-claim wb-claim-$3">
+<div class="wb-statement wb-statementview">
+ <div class="wb-statement-rank">$1</div>
+ <div class="wb-claim wb-claim-$2">
<div class="wb-claim-mainsnak" dir="auto">
- $4 <!-- wb-snak (Main Snak) -->
+ $3 <!-- wb-snak (Main Snak) -->
</div>
- <div class="wb-claim-qualifiers
wb-statement-qualifiers">$5</div>
+ <div class="wb-claim-qualifiers
wb-statement-qualifiers">$4</div>
</div>
- $6 <!-- wikibase-toolbar -->
- <div class="wb-statement-references-heading">$7</div>
+ $5 <!-- wikibase-toolbar -->
+ <div class="wb-statement-references-heading">$6</div>
<div class="wb-statement-references">
- $8 <!-- [0,*] wb-referenceview -->
+ $7 <!-- [0,*] wb-referenceview -->
</div>
</div>
HTML;
diff --git
a/extensions/Wikibase/lib/resources/wikibase.utilities/wikibase.utilities.ui.js
b/extensions/Wikibase/lib/resources/wikibase.utilities/wikibase.utilities.ui.js
index e98d264..9bc60d1 100644
---
a/extensions/Wikibase/lib/resources/wikibase.utilities/wikibase.utilities.ui.js
+++
b/extensions/Wikibase/lib/resources/wikibase.utilities/wikibase.utilities.ui.js
@@ -32,17 +32,18 @@
/**
* Creates a pretty link to an entity's page. If the label is not yet
set, then the link will
* show the entity's ID and some explanatory text describing that the
label hast not been set
- * yet. Requires an URL to the wikipage or equivalent, on which the
Entity is represented.
+ * yet. Requires a Title object.
*
* @since 0.4
*
* @param {wb.Entity} entity
- * @param {string} url
+ * @param {mw.Title} title
* @return {jQuery} An 'a' element
*/
- wb.utilities.ui.buildLinkToEntityPage = function( entity, url ) {
+ wb.utilities.ui.buildLinkToEntityPage = function( entity, title ) {
return $( '<a>' )
- .attr( 'href', url )
+ .attr( 'href', title.getUrl() )
+ .attr( 'title', title.getPrefixedText() )
.append( wb.utilities.ui.buildPrettyEntityLabel( entity
) );
};
diff --git
a/extensions/Wikibase/lib/tests/qunit/jquery.wikibase/jquery.wikibase.claimview.tests.js
b/extensions/Wikibase/lib/tests/qunit/jquery.wikibase/jquery.wikibase.claimview.tests.js
index 45d887e..074e0b1 100644
---
a/extensions/Wikibase/lib/tests/qunit/jquery.wikibase/jquery.wikibase.claimview.tests.js
+++
b/extensions/Wikibase/lib/tests/qunit/jquery.wikibase/jquery.wikibase.claimview.tests.js
@@ -25,7 +25,7 @@
entityStore: entityStore
};
- return mw.template('wb-claim', 'new', 'wb-last', '', '')
+ return mw.template('wb-claim', 'new', '', '')
.addClass( 'test_claimview' )
.claimview( options );
}
diff --git a/extensions/Wikibase/repo/Wikibase.i18n.php
b/extensions/Wikibase/repo/Wikibase.i18n.php
index f789a14..182746f 100644
--- a/extensions/Wikibase/repo/Wikibase.i18n.php
+++ b/extensions/Wikibase/repo/Wikibase.i18n.php
@@ -5802,7 +5802,7 @@
'wikibase-setsitelink-not-item' => 'شناسهٔ $1 متعلق به یک مورد نیست.',
'wikibase-setsitelink-not-badge' => 'مورد $1 یک نشان نیست.',
'wikibase-setsitelink-add-failed' => 'نشانی وبگاه ذخیره نمیشود.',
- 'wikibase-setsitelink-remove-failed' => 'لینک سایت را نمی توان حذف
کرد.',
+ 'wikibase-setsitelink-remove-failed' => 'پیوند وبگاه را نمیتوان حذف
کرد.',
'wikibase-modifyentity-id' => 'شناسه:',
'wikibase-modifyterm-language' => 'زبان:',
'special-mergeitems' => 'ادغام دو مورد',
@@ -5892,10 +5892,10 @@
'wikibase-item-summary-wbsetaliases-add' => 'افزودن {{PLURAL:$1|نام
مستعار|نامهای مستعار}} [$2]',
'wikibase-item-summary-wbsetaliases-remove' => 'حذف {{PLURAL:$1|نام
مستعار|نامهای مستعار}} [$2]',
'wikibase-item-summary-wbsetsitelink-add' => 'پیوند مشخصکنندهٔ وبگاه
[$2] افزوده شد',
- 'wikibase-item-summary-wbsetsitelink-add-both' => 'لینک اضافه شده با
نشانها به [$2]',
+ 'wikibase-item-summary-wbsetsitelink-add-both' => 'پیوند اضافهشده با
نشانها به [$2]',
'wikibase-item-summary-wbsetsitelink-set' => 'پیوند به [$2] تغییر یافت',
'wikibase-item-summary-wbsetsitelink-set-badges' => 'تغییر نشانها برای
[$2]',
- 'wikibase-item-summary-wbsetsitelink-set-both' => 'تغییر لینک و نشانها
برای [$2]',
+ 'wikibase-item-summary-wbsetsitelink-set-both' => 'تغییر پیوند و
نشانها برای [$2]',
'wikibase-item-summary-wbsetsitelink-remove' => 'حذف پیوند مشخصکنندهٔ
وبگاه [$2]',
'wikibase-item-summary-wblinktitles-create' => 'ساخت این آیتم برای
پیوند صفحه های',
'wikibase-item-summary-wblinktitles-connect' => 'افزودن یک پیوند زبانی
برای ارتباط صفحه های',
@@ -5936,9 +5936,9 @@
'wikibase-property-summary-wbsetaliases-remove' => 'حذف {{PLURAL:$1|نام
مستعار|نام مستعار}} [$2]',
'wikibase-property-summary-special-create-property' => 'ایجاد یک ویژگی
[$2] با {{PLURAL:$1|مقدار|مقدارها}}',
'wikibase-listdatatypes-wikibase-item-head' => 'آیتم',
- 'wikibase-listdatatypes-wikibase-item-body' => 'لینک برای دیگر موارد در
پروژه. در طول ورود "مورد" فضای نام در اطلاعات ویکی برای تطبیق ورودیها جستجو
خواهدشد. این شامل زمینه متن ورودی تنها است.',
+ 'wikibase-listdatatypes-wikibase-item-body' => 'پیوند برای دیگر موارد
در پروژه. در طول ورود «مورد» فضای نام در اطلاعات ویکی برای تطبیق ورودیها جستجو
خواهدشد. این شامل زمینه متن ورودی تنها است.',
'wikibase-listdatatypes-commonsmedia-head' => 'رسانههای ویکیانبار',
- 'wikibase-listdatatypes-commonsmedia-body' => 'لینک برای پوشههای ذخیره
شده در مدیاویکی عادی. در طول ورود "پوشه" فضای نام عادی ویکی برای تطبیق ورودیها
جستجو خواهدشد.',
+ 'wikibase-listdatatypes-commonsmedia-body' => 'پیوند برای پوشههای
ذخیرهشده در مدیاویکی عادی. در طول ورود «پوشه» فضای نام عادی ویکی برای تطبیق
ورودیها جستجو خواهدشد.',
'wikibase-listdatatypes-globe-coordinate-head' => 'مختصات جغرافیایی',
'wikibase-listdatatypes-globe-coordinate-body' => 'داده حروفی برای مکان
جغرافیایی یک جرم درخشان آسمانی که به صورت طول جغرافیایی-عرض جغرافیایی بر حسب
درجه یا بوسیله سامانههای زئومتریک بیان میشود.
* عرض جغرافیایی - بخش اول مقدار داده که به صورت یک رشته و بر حسب (شناوری در
هوا، درجه-دقیقه-ثانیه، درجه-دقیقه، درجه-درجه) بیان شده و جهت آن با یک حرف مخفف
(شمالی/جنوبی) مشخص می شود
diff --git a/extensions/Wikibase/repo/includes/ClaimHtmlGenerator.php
b/extensions/Wikibase/repo/includes/ClaimHtmlGenerator.php
index 33e399d..6c13b76 100644
--- a/extensions/Wikibase/repo/includes/ClaimHtmlGenerator.php
+++ b/extensions/Wikibase/repo/includes/ClaimHtmlGenerator.php
@@ -125,7 +125,6 @@
// @todo: Use 'wb-claim' or 'wb-statement' template accordingly
// @todo: get rid of usage of global wfTemplate function
$claimHtml = wfTemplate( 'wb-statement',
- '', // additional classes
$rankHtml,
$claim->getGuid(),
$mainSnakHtml,
@@ -157,9 +156,7 @@
);
}
- return wfTemplate( 'wb-listview',
- $snaklistviewsHtml
- );
+ return $this->wrapInListview( $snaklistviewsHtml );
}
/**
@@ -175,13 +172,15 @@
$referencesHtml .= $this->getHtmlForReference(
$reference );
}
- if( $referencesHtml !== '' ) {
- $referencesHtml = wfTemplate( 'wb-listview',
- $referencesHtml
- );
- }
+ return $this->wrapInListview( $referencesHtml );
+ }
- return $referencesHtml;
+ private function wrapInListview( $listviewContent ) {
+ if( $listviewContent !== '' ) {
+ return wfTemplate( 'wb-listview', $listviewContent );
+ } else {
+ return '';
+ }
}
/**
diff --git a/extensions/Wikibase/repo/includes/api/MergeItems.php
b/extensions/Wikibase/repo/includes/api/MergeItems.php
index af5399e..6e9a588 100644
--- a/extensions/Wikibase/repo/includes/api/MergeItems.php
+++ b/extensions/Wikibase/repo/includes/api/MergeItems.php
@@ -212,6 +212,7 @@
ApiBase::PARAM_TYPE => 'string',
),
'token' => null,
+ 'bot' => false
)
);
}
@@ -232,6 +233,9 @@
autocomment together with the summary
is 260 characters. Be aware that everything above that
limit will be cut off."
),
+ 'bot' => array( 'Mark this edit as bot',
+ 'This URL flag will only be respected
if the user belongs to the group "bot".'
+ ),
)
);
}
diff --git a/extensions/Wikibase/repo/includes/api/ResultBuilder.php
b/extensions/Wikibase/repo/includes/api/ResultBuilder.php
index a6d009a..70dcd85 100644
--- a/extensions/Wikibase/repo/includes/api/ResultBuilder.php
+++ b/extensions/Wikibase/repo/includes/api/ResultBuilder.php
@@ -128,21 +128,9 @@
* @throws InvalidArgumentException
*/
public function setList( $path, $name, array $values, $tag ){
- if ( is_string( $path ) ) {
- $path = array( $path );
- }
-
- if ( !is_array( $path ) && $path !== null ) {
- throw new InvalidArgumentException( '$path must be an
array (or null)' );
- }
-
- if ( !is_string( $name ) ) {
- throw new InvalidArgumentException( '$name must be a
string' );
- }
-
- if ( !is_string( $tag ) ) {
- throw new InvalidArgumentException( '$tag must be a
string' );
- }
+ $this->checkPathType( $path );
+ $this->checkNameIsString( $name );
+ $this->checkTagIsString( $tag );
if ( $this->options->shouldIndexTags() ) {
$values = array_values( $values );
@@ -171,21 +159,9 @@
* @throws InvalidArgumentException
*/
public function setValue( $path, $name, $value ){
- if ( is_string( $path ) ) {
- $path = array( $path );
- }
-
- if ( !is_array( $path ) && $path !== null ) {
- throw new InvalidArgumentException( '$path must be an
array (or null)' );
- }
-
- if ( !is_string( $name ) ) {
- throw new InvalidArgumentException( '$name must be a
string' );
- }
-
- if ( is_array( $value ) && isset( $value[0] ) ) {
- throw new InvalidArgumentException( '$value must not be
a list' );
- }
+ $this->checkPathType( $path );
+ $this->checkNameIsString( $name );
+ $this->checkValueIsNotList( $value );
$this->getResult()->addValue( $path, $name, $value );
}
@@ -211,25 +187,11 @@
* @throws InvalidArgumentException
*/
public function appendValue( $path, $key, $value, $tag ){
- if ( is_string( $path ) ) {
- $path = array( $path );
- }
+ $this->checkPathType( $path );
+ $this->checkKeyType( $key );
+ $this->checkTagIsString( $tag );
- if ( !is_array( $path ) && $path !== null ) {
- throw new InvalidArgumentException( '$path must be an
array (or null)' );
- }
-
- if ( $key !== null && !is_string( $key ) && !is_int( $key ) ) {
- throw new InvalidArgumentException( '$key must be a
string, int, or null' );
- }
-
- if ( !is_string( $tag ) ) {
- throw new InvalidArgumentException( '$tag must be a
string' );
- }
-
- if ( is_array( $value ) && isset( $value[0] ) ) {
- throw new InvalidArgumentException( '$value must not be
a list' );
- }
+ $this->checkValueIsNotList( $value );
if ( $this->options->shouldIndexTags() ) {
$key = null;
@@ -243,6 +205,65 @@
}
/**
+ * @param array|string|null $path
+ *
+ * @throws InvalidArgumentException
+ */
+ private function checkPathType( $path ) {
+ if ( is_string( $path ) ) {
+ $path = array( $path );
+ }
+
+ if ( !is_array( $path ) && $path !== null ) {
+ throw new InvalidArgumentException( '$path must be an
array (or null)' );
+ }
+ }
+
+ /**
+ * @param string $name
+ *
+ * @throws InvalidArgumentException
+ */
+ private function checkNameIsString( $name ) {
+ if ( !is_string( $name ) ) {
+ throw new InvalidArgumentException( '$name must be a
string' );
+ }
+ }
+
+ /**
+ * @param $key int|string|null the key to use when appending, or null
for automatic.
+ *
+ * @throws InvalidArgumentException
+ */
+ private function checkKeyType( $key ) {
+ if ( $key !== null && !is_string( $key ) && !is_int( $key ) ) {
+ throw new InvalidArgumentException( '$key must be a
string, int, or null' );
+ }
+ }
+
+ /**
+ * @param string $tag tag name to use for elements of $values
+ *
+ * @throws InvalidArgumentException
+ */
+ private function checkTagIsString( $tag ) {
+ if ( !is_string( $tag ) ) {
+ throw new InvalidArgumentException( '$tag must be a
string' );
+ }
+ }
+
+ /**
+ * @param mixed $value
+ *
+ * @throws InvalidArgumentException
+ */
+ private function checkValueIsNotList( $value ) {
+ if ( is_array( $value ) && isset( $value[0] ) ) {
+ throw new InvalidArgumentException( '$value must not be
a list' );
+ }
+ }
+
+ /**
* Get serialized entity for the EntityRevision and add it to the result
*
* @param EntityRevision $entityRevision
diff --git a/extensions/Wikibase/repo/includes/content/EntityHandler.php
b/extensions/Wikibase/repo/includes/content/EntityHandler.php
index cc37837..f6c5787 100644
--- a/extensions/Wikibase/repo/includes/content/EntityHandler.php
+++ b/extensions/Wikibase/repo/includes/content/EntityHandler.php
@@ -153,7 +153,6 @@
default:
throw new MWException( "serialization format
$format is not supported "
. "for Wikibase content model" );
- break;
}
if ( $data === false || $data === null ) {
diff --git a/vendor/autoload.php b/vendor/autoload.php
index 4ef2c9b..83fc5b0 100644
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
-return ComposerAutoloaderInite6732e724b416b47945e63865180ffe4::getLoader();
+return ComposerAutoloaderInit151f2596e8a25742708bbcfb97c1f63d::getLoader();
diff --git a/vendor/composer/autoload_real.php
b/vendor/composer/autoload_real.php
index 20c77d2..e492cc7 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInite6732e724b416b47945e63865180ffe4
+class ComposerAutoloaderInit151f2596e8a25742708bbcfb97c1f63d
{
private static $loader;
@@ -19,9 +19,9 @@
return self::$loader;
}
-
spl_autoload_register(array('ComposerAutoloaderInite6732e724b416b47945e63865180ffe4',
'loadClassLoader'), true, true);
+
spl_autoload_register(array('ComposerAutoloaderInit151f2596e8a25742708bbcfb97c1f63d',
'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-
spl_autoload_unregister(array('ComposerAutoloaderInite6732e724b416b47945e63865180ffe4',
'loadClassLoader'));
+
spl_autoload_unregister(array('ComposerAutoloaderInit151f2596e8a25742708bbcfb97c1f63d',
'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
@@ -45,14 +45,14 @@
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
- composerRequiree6732e724b416b47945e63865180ffe4($file);
+ composerRequire151f2596e8a25742708bbcfb97c1f63d($file);
}
return $loader;
}
}
-function composerRequiree6732e724b416b47945e63865180ffe4($file)
+function composerRequire151f2596e8a25742708bbcfb97c1f63d($file)
{
require $file;
}
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 347fdfb..4898ed1 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -877,12 +877,12 @@
"source": {
"type": "git",
"url":
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git",
- "reference": "0fab576bdf933b0d91953238c0ed66836661efb1"
+ "reference": "27bb6998e96887a346f62faad91494e872e4d48e"
},
"dist": {
"type": "zip",
- "url":
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/0fab576bdf933b0d91953238c0ed66836661efb1",
- "reference": "0fab576bdf933b0d91953238c0ed66836661efb1",
+ "url":
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/27bb6998e96887a346f62faad91494e872e4d48e",
+ "reference": "27bb6998e96887a346f62faad91494e872e4d48e",
"shasum": ""
},
"require": {
@@ -901,7 +901,7 @@
"wikibase/data-model": "~0.7.2",
"wikibase/easyrdf_lite": "~0.8.1"
},
- "time": "2014-03-18 21:02:54",
+ "time": "2014-03-20 09:43:11",
"type": "mediawiki-extension",
"installation-source": "dist",
"autoload": {
--
To view, visit https://gerrit.wikimedia.org/r/119728
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8dc465205ea21839349ff9b6e7424d2b963f99b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikidata
Gerrit-Branch: master
Gerrit-Owner: WikidataBuilder <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits