jenkins-bot has submitted this change and it was merged.

Change subject: Make removeClaimsEntityId check case insenstive
......................................................................


Make removeClaimsEntityId check case insenstive

Bug: 54109

Change-Id: Idd98d9d9e8c6843002510ee9ff95f1c260bea57e
---
M repo/includes/api/RemoveClaims.php
1 file changed, 6 insertions(+), 5 deletions(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/api/RemoveClaims.php 
b/repo/includes/api/RemoveClaims.php
index 8674260..2594562 100644
--- a/repo/includes/api/RemoveClaims.php
+++ b/repo/includes/api/RemoveClaims.php
@@ -82,6 +82,7 @@
         * @return EntityId
         */
        protected function getEntityId( array $params ) {
+               $claimGuidParser = 
WikibaseRepo::getDefaultInstance()->getClaimGuidParser();
                $entityId = null;
 
                foreach ( $params['claim'] as $guid ) {
@@ -89,16 +90,16 @@
                                $this->dieUsage( "Invalid claim guid $guid" , 
'invalid-guid' );
                        }
 
-                       if ( !is_null( $entityId ) ) {
-                               if ( Entity::getIdFromClaimGuid( $guid ) !== 
$entityId ) {
+                       if ( is_null( $entityId ) ) {
+                               $entityId = $claimGuidParser->parse( $guid 
)->getEntityId();
+                       } else {
+                               if ( !$claimGuidParser->parse( $guid 
)->getEntityId()->equals( $entityId ) ) {
                                        $this->dieUsage( 'All claims must 
belong to the same entity' , 'invalid-guid' );
                                }
-                       } else {
-                               $entityId = Entity::getIdFromClaimGuid( $guid );
                        }
                }
 
-               return $this->claimModificationHelper->getEntityIdFromString( 
$entityId );
+               return $entityId ;
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd98d9d9e8c6843002510ee9ff95f1c260bea57e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to