jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/366834 )

Change subject: Default constraint parameters to []
......................................................................


Default constraint parameters to []

I don’t know why $constraintParameters would ever be null here, but it
seems to happen, so for now default to empty parameters in that case.

Bug: T171295
Change-Id: I2002e3aa727fd0d0dfba0c74c4847107a47c3735
---
M includes/ConstraintRepository.php
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Daniel Kinzler: Looks good to me, approved
  jenkins-bot: Verified
  Thiemo Mättig (WMDE): Looks good to me, but someone else must approve



diff --git a/includes/ConstraintRepository.php 
b/includes/ConstraintRepository.php
index 29fbd93..b326501 100644
--- a/includes/ConstraintRepository.php
+++ b/includes/ConstraintRepository.php
@@ -137,6 +137,17 @@
                        $constraintTypeItemId = $result->constraint_type_qid;
                        $constraintParameters = json_decode( 
$result->constraint_parameters, true );
 
+                       if ( $constraintParameters === null ) {
+                               // T171295
+                               LoggerFactory::getInstance( 
'WikibaseQualityConstraints' )
+                                       ->warning( 'Constraint {constraintId} 
has invalid constraint parameters.', [
+                                               'method' => __METHOD__,
+                                               'constraintId' => 
$result->constraint_guid,
+                                               'constraintParameters' => 
$result->constraint_parameters,
+                                       ] );
+                               $constraintParameters = [];
+                       }
+
                        $constraints[] = new Constraint(
                                $result->constraint_guid,
                                PropertyId::newFromNumber( $result->pid ),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2002e3aa727fd0d0dfba0c74c4847107a47c3735
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to