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

Change subject: Remove support for linking to property talk pages
......................................................................

Remove support for linking to property talk pages

Since there are no more constraints imported from templates, all
constraint IDs should be valid statement GUIDs, and we can remove the
fallback of linking to the property talk page.

Bug: T171291
Change-Id: I7524c1e2166f54eb15f430dfb2ee853173e40ccf
---
M api/CheckConstraints.php
1 file changed, 4 insertions(+), 14 deletions(-)


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

diff --git a/api/CheckConstraints.php b/api/CheckConstraints.php
index 0155a21..e345017 100644
--- a/api/CheckConstraints.php
+++ b/api/CheckConstraints.php
@@ -342,20 +342,10 @@
                        $typeItemId = 
$checkResult->getConstraint()->getConstraintTypeItemId();
 
                        $title = $this->entityTitleLookup->getTitleForId( 
$checkResult->getPropertyId() );
-                       try {
-                               $statementGuid = 
$this->statementGuidParser->parse( $constraintId );
-                               // constraint statement
-                               $typeLabel = 
$this->entityIdLabelFormatter->formatEntityId( new ItemId( $typeItemId ) );
-                               // TODO link to the statement when possible 
(T169224)
-                               $link = $title->getFullUrl() . '#' . 
$this->config->get( 'WBQualityConstraintsPropertyConstraintId' );
-                       } catch ( StatementGuidParsingException $e ) {
-                               // constraint template on talk page
-                               $typeLabel = htmlspecialchars( $typeItemId );
-                               if ( !$title->canHaveTalkPage() ) {
-                                       throw new MWException( 'Properties 
namespace must define a talk namespace' );
-                               }
-                               $link = 
$title->getTalkPageIfDefined()->getFullUrl();
-                       }
+                       $statementGuid = $this->statementGuidParser->parse( 
$constraintId );
+                       $typeLabel = 
$this->entityIdLabelFormatter->formatEntityId( new ItemId( $typeItemId ) );
+                       // TODO link to the statement when possible (T169224)
+                       $link = $title->getFullUrl() . '#' . 
$this->config->get( 'WBQualityConstraintsPropertyConstraintId' );
 
                        $result = [
                                'status' => $checkResult->getStatus(),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7524c1e2166f54eb15f430dfb2ee853173e40ccf
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