Hoo man has uploaded a new change for review.

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

Change subject: Assure we have an Entity with EntityId in 
EntityParserOutputGenerator
......................................................................

Assure we have an Entity with EntityId in EntityParserOutputGenerator

Apparently that's not always the case (hit that on testwikidata).

Potentially due to screwed up content there.

Change-Id: I56f3267cbc213a455bef5dfc95d1dcb2f555626e
(cherry picked from commit 52dd6ef614b4d64727482ea2eecd68aef436ff70)
---
M repo/includes/EntityParserOutputGenerator.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/26/222026/1

diff --git a/repo/includes/EntityParserOutputGenerator.php 
b/repo/includes/EntityParserOutputGenerator.php
index 02d5ca1..a5f2ce4 100644
--- a/repo/includes/EntityParserOutputGenerator.php
+++ b/repo/includes/EntityParserOutputGenerator.php
@@ -200,7 +200,11 @@
                // set the display title
                //$parserOutput->setTitleText( $entity>getLabel( $langCode ) );
 
-               $this->addAlternateLinks( $parserOutput, $entity->getId() );
+               if ( $entity->getId() !== null ) {
+                       $this->addAlternateLinks( $parserOutput, 
$entity->getId() );
+               } else {
+                       wfLogWarning( "Encountered an Entity without EntityId 
in EntityParserOutputGenerator." );
+               }
 
                return $parserOutput;
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I56f3267cbc213a455bef5dfc95d1dcb2f555626e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: wmf/1.26wmf12
Gerrit-Owner: Hoo man <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to