Lucas Werkmeister (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389489 )

Change subject: Skip “type” constraints on references
......................................................................

Skip “type” constraints on references

While it sometimes makes sense to check “type” constraints on
qualifiers, I’m not aware of any case where it makes sense on
references, and there are plenty of cases where it doesn’t make sense,
so let’s partially revert commit 9024527329 (change Ic5d3fa1d15).

Bug: T178147
Change-Id: Ie82b478767e84fbe18a4922ee7f3a46762e82992
---
M includes/ConstraintCheck/Checker/TypeChecker.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/89/389489/1

diff --git a/includes/ConstraintCheck/Checker/TypeChecker.php 
b/includes/ConstraintCheck/Checker/TypeChecker.php
index 71e212e..9b9f046 100644
--- a/includes/ConstraintCheck/Checker/TypeChecker.php
+++ b/includes/ConstraintCheck/Checker/TypeChecker.php
@@ -73,6 +73,9 @@
                if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) {
                        return new CheckResult( $context, $constraint, [], 
CheckResult::STATUS_DEPRECATED );
                }
+               if ( $context->getType() === Context::TYPE_REFERENCE ) {
+                       return new CheckResult( $context, $constraint, [], 
CheckResult::STATUS_NOT_MAIN_SNAK );
+               }
 
                $parameters = [];
                $constraintParameters = $constraint->getConstraintParameters();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie82b478767e84fbe18a4922ee7f3a46762e82992
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>

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

Reply via email to