jenkins-bot has submitted this change and it was merged.
Change subject: DM 1.0 compat: do not use EntityId constructor
......................................................................
DM 1.0 compat: do not use EntityId constructor
Change-Id: I09cce86c82412fec9148be05995428434528cfd4
---
M lib/includes/store/sql/SqlEntityInfoBuilder.php
1 file changed, 6 insertions(+), 3 deletions(-)
Approvals:
WikidataJenkins: Verified
Thiemo Mättig (WMDE): Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/includes/store/sql/SqlEntityInfoBuilder.php
b/lib/includes/store/sql/SqlEntityInfoBuilder.php
index 7ea4949..4c9b2bd 100644
--- a/lib/includes/store/sql/SqlEntityInfoBuilder.php
+++ b/lib/includes/store/sql/SqlEntityInfoBuilder.php
@@ -12,6 +12,7 @@
use Wikibase\DataModel\Entity\EntityIdParsingException;
use Wikibase\DataModel\Entity\Property;
use Wikibase\DataModel\Entity\PropertyId;
+use Wikibase\DataModel\LegacyIdInterpreter;
use Wikibase\Lib\Store\EntityInfoBuilder;
/**
@@ -383,10 +384,12 @@
* @throws InvalidArgumentException
*/
private function injectTerms( ResultWrapper $dbResult ) {
+ $idParser = new LegacyIdInterpreter();
+
foreach ( $dbResult as $row ) {
- // this is deprecated, but I don't see an alternative.
- $id = new EntityId( $row->term_entity_type,
(int)$row->term_entity_id );
- $key = $id->getPrefixedId();
+ // FIXME: this only works for items and properties
+ $id = $idParser->newIdFromTypeAndNumber(
$row->term_entity_type, (int)$row->term_entity_id );
+ $key = $id->getSerialization();
if ( !isset( $this->entityInfo[$key] ) ) {
continue;
--
To view, visit https://gerrit.wikimedia.org/r/149228
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I09cce86c82412fec9148be05995428434528cfd4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: WikidataJenkins <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits