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

Change subject: Fix ValueTypeChecker message formatting
......................................................................

Fix ValueTypeChecker message formatting

Looks like I missed this in commit b73ad2da (change I8cd68ad203).

Change-Id: I7c263f3bee72d93f7f13a2ea6c90756796bac75e
---
M includes/ConstraintCheck/Checker/ValueTypeChecker.php
1 file changed, 9 insertions(+), 2 deletions(-)


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

diff --git a/includes/ConstraintCheck/Checker/ValueTypeChecker.php 
b/includes/ConstraintCheck/Checker/ValueTypeChecker.php
index 95799f7..45aaa0e 100644
--- a/includes/ConstraintCheck/Checker/ValueTypeChecker.php
+++ b/includes/ConstraintCheck/Checker/ValueTypeChecker.php
@@ -105,7 +105,9 @@
                 *   $mainSnak must be PropertyValueSnak, neither 
PropertySomeValueSnak nor PropertyNoValueSnak is allowed
                 */
                if ( !$mainSnak instanceof PropertyValueSnak ) {
-                       $message = wfMessage( 
"wbqc-violation-message-value-needed" )->params( 
$constraint->getConstraintTypeItemId() )->escaped();
+                       $message = wfMessage( 
"wbqc-violation-message-value-needed" )
+                               ->rawParams( 
$this->constraintParameterRenderer->formatItemId( 
$constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM ) )
+                               ->escaped();
                        return new CheckResult( $entity->getId(), $statement, 
$constraint, $parameters, CheckResult::STATUS_VIOLATION, $message );
                }
 
@@ -116,7 +118,12 @@
                 *   type of $dataValue for properties with 'Value type' 
constraint has to be 'wikibase-entityid'
                 */
                if ( $dataValue->getType() !== 'wikibase-entityid' ) {
-                       $message = wfMessage( 
"wbqc-violation-message-value-needed-of-type" )->params( 
$constraint->getConstraintTypeItemId(), 'wikibase-entityid' )->escaped();
+                       $message = wfMessage( 
"wbqc-violation-message-value-needed-of-type" )
+                               ->rawParams(
+                                       
$this->constraintParameterRenderer->formatItemId( 
$constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM ),
+                                       'wikibase-entityid' // TODO is there a 
message for this type so we can localize it?
+                               )
+                               ->escaped();
                        return new CheckResult( $entity->getId(), $statement, 
$constraint, $parameters, CheckResult::STATUS_VIOLATION, $message );
                }
                /** @var EntityIdValue $dataValue */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c263f3bee72d93f7f13a2ea6c90756796bac75e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <lucas.werkmeis...@wikimedia.de>

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

Reply via email to