diff options
author | 2020-10-02 22:35:44 -0400 | |
---|---|---|
committer | 2020-10-02 22:35:44 -0400 | |
commit | e735b300b095690e93c0ed1f20dfbd6ee8ca3ba6 (patch) | |
tree | 2bcf86344b01626ef21ed5b675c88a3cca8d09da | |
parent | Update MLEB to 2020.07 (diff) | |
download | extensions-e735b300b095690e93c0ed1f20dfbd6ee8ca3ba6.tar.gz extensions-e735b300b095690e93c0ed1f20dfbd6ee8ca3ba6.tar.bz2 extensions-e735b300b095690e93c0ed1f20dfbd6ee8ca3ba6.zip |
Fix CommentStreams from blowing up
Signed-off-by: Brian Evans <grknight@gentoo.org>
-rw-r--r-- | CommentStreams/includes/CommentStreamsHooks.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/CommentStreams/includes/CommentStreamsHooks.php b/CommentStreams/includes/CommentStreamsHooks.php index 38afb6d3..897ce9c8 100644 --- a/CommentStreams/includes/CommentStreamsHooks.php +++ b/CommentStreams/includes/CommentStreamsHooks.php @@ -32,6 +32,8 @@ use PPFrame; use SearchResult; use Skin; use SMW\DIWikiPage; +use SMW\DIProperty; +use SMW\PropertyRegistry; use SpecialSearch; use Status; use Title; @@ -403,7 +405,7 @@ class CommentStreamsHooks { * This won't get called unless Semantic MediaWiki is installed. */ public static function initProperties() { - $pr = SMW\PropertyRegistry::getInstance(); + $pr = PropertyRegistry::getInstance(); $pr->registerProperty( '___CS_ASSOCPG', '_wpg', 'Comment on' ); $pr->registerProperty( '___CS_REPLYTO', '_wpg', 'Reply to' ); $pr->registerProperty( '___CS_TITLE', '_txt', 'Comment title of' ); @@ -439,7 +441,7 @@ class CommentStreamsHooks { if ( $assoc_page_id !== null ) { $assoc_wikipage = WikiPage::newFromId( $assoc_page_id ); if ( $assoc_wikipage !== null ) { - $propertyDI = new SMW\DIProperty( '___CS_ASSOCPG' ); + $propertyDI = new DIProperty( '___CS_ASSOCPG' ); $dataItem = DIWikiPage::newFromTitle( $assoc_wikipage->getTitle() ); $semanticData->addPropertyObjectValue( $propertyDI, $dataItem ); @@ -450,7 +452,7 @@ class CommentStreamsHooks { if ( $parent_page_id !== null ) { $parent_wikipage = WikiPage::newFromId( $parent_page_id ); if ( $parent_wikipage !== null ) { - $propertyDI = new SMW\DIProperty( '___CS_REPLYTO' ); + $propertyDI = new DIProperty( '___CS_REPLYTO' ); $dataItem = DIWikiPage::newFromTitle( $parent_wikipage->getTitle() ); $semanticData->addPropertyObjectValue( $propertyDI, $dataItem ); @@ -459,22 +461,22 @@ class CommentStreamsHooks { $commentTitle = $comment->getCommentTitle(); if ( $commentTitle !== null ) { - $propertyDI = new SMW\DIProperty( '___CS_TITLE' ); + $propertyDI = new DIProperty( '___CS_TITLE' ); $dataItem = new SMWDIBlob( $comment->getCommentTitle() ); $semanticData->addPropertyObjectValue( $propertyDI, $dataItem ); } if ( $GLOBALS['wgCommentStreamsEnableVoting'] === true ) { $upvotes = $comment->getNumUpVotes(); - $propertyDI = new SMW\DIProperty( '___CS_UPVOTES' ); + $propertyDI = new DIProperty( '___CS_UPVOTES' ); $dataItem = new SMWDINumber( $upvotes ); $semanticData->addPropertyObjectValue( $propertyDI, $dataItem ); $downvotes = $comment->getNumDownVotes(); - $propertyDI = new SMW\DIProperty( '___CS_DOWNVOTES' ); + $propertyDI = new DIProperty( '___CS_DOWNVOTES' ); $dataItem = new SMWDINumber( $downvotes ); $semanticData->addPropertyObjectValue( $propertyDI, $dataItem ); $votediff = $upvotes - $downvotes; - $propertyDI = new SMW\DIProperty( '___CS_VOTEDIFF' ); + $propertyDI = new DIProperty( '___CS_VOTEDIFF' ); $dataItem = new SMWDINumber( $votediff ); $semanticData->addPropertyObjectValue( $propertyDI, $dataItem ); } |