Aude has uploaded a new change for review.

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

Change subject: Update Wikidata, fix js error and diff formatting
......................................................................

Update Wikidata, fix js error and diff formatting

also adds more debug logging for UpdateRepoJob

Change-Id: Ia03d21c4b6d2a68182d211b7c806bf61c50f5911
---
M composer.lock
M extensions/Wikibase/composer.json
M extensions/Wikibase/lib/includes/formatters/TimeDetailsFormatter.php
M 
extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
M extensions/Wikibase/repo/includes/UpdateRepo/UpdateRepoJob.php
M vendor/composer/installed.json
6 files changed, 29 insertions(+), 20 deletions(-)


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

diff --git a/composer.lock b/composer.lock
index 7249ff8..c812554 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1234,12 +1234,12 @@
             "source": {
                 "type": "git",
                 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-                "reference": "07c8c09280a80d597ea650fef0510c19c219d41d"
+                "reference": "2a64ea002f5fe36510bb0953d7bc24eddd3d0419"
             },
             "dist": {
                 "type": "zip",
-                "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/07c8c09280a80d597ea650fef0510c19c219d41d";,
-                "reference": "07c8c09280a80d597ea650fef0510c19c219d41d",
+                "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/2a64ea002f5fe36510bb0953d7bc24eddd3d0419";,
+                "reference": "2a64ea002f5fe36510bb0953d7bc24eddd3d0419",
                 "shasum": ""
             },
             "require": {
@@ -1256,7 +1256,7 @@
                 "data-values/value-view": "~0.11.0",
                 "diff/diff": "~1.0",
                 "php": ">=5.3.2",
-                "wikibase/data-model": "~2.5",
+                "wikibase/data-model": "2.5.0",
                 "wikibase/data-model-javascript": "~1.0",
                 "wikibase/data-model-serialization": "~1.2",
                 "wikibase/easyrdf_lite": "~0.8.1",
@@ -1306,7 +1306,7 @@
                 "wikibaserepo",
                 "wikidata"
             ],
-            "time": "2015-02-25 22:37:05"
+            "time": "2015-03-16 14:02:25"
         },
         {
             "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/composer.json 
b/extensions/Wikibase/composer.json
index 0df2796..4345450 100644
--- a/extensions/Wikibase/composer.json
+++ b/extensions/Wikibase/composer.json
@@ -35,7 +35,7 @@
                "data-values/javascript": "~0.6.0",
                "data-values/value-view": "~0.11.0",
 
-               "wikibase/data-model": "~2.5",
+               "wikibase/data-model": "2.5.0",
                "wikibase/data-model-javascript": "~1.0",
                "wikibase/data-model-serialization": "~1.2",
                "wikibase/javascript-api": "~1.0",
diff --git 
a/extensions/Wikibase/lib/includes/formatters/TimeDetailsFormatter.php 
b/extensions/Wikibase/lib/includes/formatters/TimeDetailsFormatter.php
index 5e5a021..94c19a4 100644
--- a/extensions/Wikibase/lib/includes/formatters/TimeDetailsFormatter.php
+++ b/extensions/Wikibase/lib/includes/formatters/TimeDetailsFormatter.php
@@ -44,7 +44,7 @@
                        $options->setOption( 
TimeFormatter::OPT_TIME_ISO_FORMATTER, $this->isoTimeFormatter );
                }
 
-               $this->timeFormatter = new TimeFormatter( $options );
+               $this->timeFormatter = $this->isoTimeFormatter;
        }
 
        /**
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 d0953cc..35c1bdc 100644
--- 
a/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
+++ 
b/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
@@ -246,12 +246,16 @@
                                // claimlistview featuring the specific 
property yet. Instead, use the already
                                // existing pending claimlistview.
                                // TODO: Assume that there are more than one 
item to be added.
-                               var newStatements = lia.liInstance( 
$claimlistview ).value(),
-                                       newPropertyId = 
newStatements[0].getClaim().getMainSnak().getPropertyId();
+                               var newStatements = lia.liInstance( 
$claimlistview ).value();
 
                                self.listview().removeItem( $claimlistview );
 
-                               var correspondingClaimlistview = 
self._findClaimlistview( newPropertyId );
+                               if ( newStatements === null ) {
+                                       return;
+                               }
+
+                               var newPropertyId = 
newStatements[0].getClaim().getMainSnak().getPropertyId(),
+                                       correspondingClaimlistview = 
self._findClaimlistview( newPropertyId );
 
                                if( correspondingClaimlistview ) {
                                        
correspondingClaimlistview.listview().addItem( newStatements[0] );
@@ -283,7 +287,7 @@
                        var claimlistview = lia.liInstance( $claimlistviews.eq( 
i ) ),
                                claims = claimlistview.value();
 
-                       if( !claims.length ) {
+                       if( !claims || !claims.length ) {
                                continue;
                        }
 
diff --git a/extensions/Wikibase/repo/includes/UpdateRepo/UpdateRepoJob.php 
b/extensions/Wikibase/repo/includes/UpdateRepo/UpdateRepoJob.php
index 206e69d..b357f5e 100644
--- a/extensions/Wikibase/repo/includes/UpdateRepo/UpdateRepoJob.php
+++ b/extensions/Wikibase/repo/includes/UpdateRepo/UpdateRepoJob.php
@@ -132,16 +132,20 @@
                } catch ( StorageException $ex ) {
                        wfDebugLog(
                                'UpdateRepo',
-                               __FUNCTION__ . ": EntityRevision not found for 
" . $itemId->getSerialization()
+                               __FUNCTION__ . ": EntityRevision couldn't be 
loaded for " . $itemId->getSerialization() . ": " . $ex->getMessage()
                        );
 
-                       $entityRevision = null;
+                       return null;
                }
 
                if ( $entityRevision ) {
                        return $entityRevision->getEntity();
                }
 
+               wfDebugLog(
+                       'UpdateRepo',
+                       __FUNCTION__ . ": EntityRevision not found for " . 
$itemId->getSerialization()
+               );
                return null;
        }
 
@@ -155,6 +159,7 @@
         */
        private function saveChanges( Item $item, User $user ) {
                $summary = $this->getSummary();
+               $itemId = $item->getId();
 
                $editEntity = new EditEntity(
                        $this->entityTitleLookup,
@@ -173,11 +178,11 @@
                        EDIT_UPDATE,
                        false,
                        // Don't (un)watch any pages here, as the user didn't 
explicitly kick this off
-                       $this->entityStore->isWatching( $user, $item->getid() )
+                       $this->entityStore->isWatching( $user, $itemId )
                );
 
                if ( !$status->isOK() ) {
-                       wfDebugLog( __CLASS__, __FUNCTION__ . ": attemptSave 
for " . $item->getId()->getSerialization() . " failed: " . 
$status->getMessage()->text() );
+                       wfDebugLog( 'UpdateRepo', __FUNCTION__ . ": attemptSave 
for " . $itemId->getSerialization() . " failed: " . 
$status->getMessage()->text() );
                }
 
                wfProfileOut( __METHOD__ );
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index e2b271f..df9d55c 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1326,12 +1326,12 @@
         "source": {
             "type": "git",
             "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-            "reference": "07c8c09280a80d597ea650fef0510c19c219d41d"
+            "reference": "2a64ea002f5fe36510bb0953d7bc24eddd3d0419"
         },
         "dist": {
             "type": "zip",
-            "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/07c8c09280a80d597ea650fef0510c19c219d41d";,
-            "reference": "07c8c09280a80d597ea650fef0510c19c219d41d",
+            "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/2a64ea002f5fe36510bb0953d7bc24eddd3d0419";,
+            "reference": "2a64ea002f5fe36510bb0953d7bc24eddd3d0419",
             "shasum": ""
         },
         "require": {
@@ -1348,7 +1348,7 @@
             "data-values/value-view": "~0.11.0",
             "diff/diff": "~1.0",
             "php": ">=5.3.2",
-            "wikibase/data-model": "~2.5",
+            "wikibase/data-model": "2.5.0",
             "wikibase/data-model-javascript": "~1.0",
             "wikibase/data-model-serialization": "~1.2",
             "wikibase/easyrdf_lite": "~0.8.1",
@@ -1359,7 +1359,7 @@
         "conflict": {
             "mediawiki/mediawiki": "<1.23"
         },
-        "time": "2015-02-25 22:37:05",
+        "time": "2015-03-16 14:02:25",
         "type": "mediawiki-extension",
         "installation-source": "dist",
         "autoload": {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia03d21c4b6d2a68182d211b7c806bf61c50f5911
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikidata
Gerrit-Branch: wmf/1.25wmf19
Gerrit-Owner: Aude <aude.w...@gmail.com>

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

Reply via email to