Last modified: 2014-11-07 16:29:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T74879, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72879 - support statements on properties in changeops
support statements on properties in changeops
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Wikidata bugs
u=dev c=backend p=0
:
Depends on:
Blocks: 49554 72314
  Show dependency treegraph
 
Reported: 2014-11-02 14:23 UTC by Aude
Modified: 2014-11-07 16:29 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Aude 2014-11-02 14:23:00 UTC
While https://gerrit.wikimedia.org/r/#/c/170576/ addresses this issue in ChangeOpClaim, we have use of $entity->getClaims() in other ChangeOp classes: 

./ChangeOpClaimRemove.php:	$claims = new Claims( $entity->getClaims() );
./ChangeOpMainSnak.php:		$claims = new Claims( $entity->getClaims() );
./ChangeOpQualifier.php:	$claims = new Claims( $entity->getClaims() );
./ChangeOpQualifierRemove.php:	$claims = new Claims( $entity->getClaims() );
./ChangeOpReference.php:	$claims = new Claims( $entity->getClaims() );
./ChangeOpReferenceRemove.php:	$claims = new Claims( $entity->getClaims() );
./ChangeOpsMerge.php:		foreach ( $this->fromItem->getClaims() as $fromClaim ) {
./ChangeOpsMerge.php:		foreach ( $this->toItem->getClaims() as $claim ) {
./ChangeOpStatementRank.php:	$claims = new Claims( $entity->getClaims() );

For an Item, that returns claims.  For Property, getClaims() is not implemented so uses Entity::getClaims which returns an empty array!

This is going to be problematic for statements on properties, as well as perhaps other issues in ChangeOps. (and simply the confusion about Claims vs. Statements, since the api modules are called things like 'wbsetclaim')
Comment 1 Lydia Pintscher 2014-11-06 14:20:56 UTC
Jeroen: Can you please look into this? The changes in the new data model are causing issues here and it seems we said we would always use statements and get rid of modeling for claims. This separation now is breaking things like this.
Comment 2 Jeroen De Dauw 2014-11-06 17:25:09 UTC
Lydia: the issue here is not in the DataModel, it's in the usage of deprecated code. This code got deprecated quite some time ago, and the implications have been discussed already several times. This includes the not type hinting against Entity, which appears to be happening in the posted code. We have many such places, and it's a task for the whole team to fix this and not introduce new such cases.
Comment 3 Jeroen De Dauw 2014-11-07 16:29:17 UTC
Demonstration of how the pressing issue can be resolved: https://gerrit.wikimedia.org/r/#/c/171845/

Commit description also points to the two remaining issues there, one of which is the code not being able to deal with new types of entities as described in https://lists.wikimedia.org/pipermail/wikidata-tech/2014-June/000489.html

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links