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

Change subject: Add GetLogTypesOnUser hook
......................................................................


Add GetLogTypesOnUser hook

Allows extensions to modify the list at SpecialLog::$typeOnUser
This is useful for extensions like Thanks where the target is a
userpage.

Change-Id: I77e1e59d7e3666802d0eeb0c48a0ec211dba0a2a
---
M docs/hooks.txt
M includes/specials/SpecialLog.php
2 files changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/docs/hooks.txt b/docs/hooks.txt
index ec6ce73..22f61b6 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -1213,6 +1213,9 @@
 $title: Title object of page
 &$url: string value as output (out parameter, can modify)
 
+'GetLogTypesOnUser': Add log types where the target is a userpage
+&$types: Array of log types
+
 'GetMetadataVersion': Modify the image metadata version currently in use. This
 is used when requesting image metadata from a ForeignApiRepo. Media handlers
 that need to have versioned metadata should add an element to the end of the
diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php
index 2ffdd89..5265403 100644
--- a/includes/specials/SpecialLog.php
+++ b/includes/specials/SpecialLog.php
@@ -98,6 +98,7 @@
                # Some log types are only for a 'User:' title but we might have 
been given
                # only the username instead of the full title 'User:username'. 
This part try
                # to lookup for a user by that name and eventually fix user 
input. See bug 1697.
+               wfRunHooks( 'GetLogTypesOnUser', array( &$this->typeOnUser ) );
                if ( in_array( $opts->getValue( 'type' ), $this->typeOnUser ) ) 
{
                        # ok we have a type of log which expect a user title.
                        $target = Title::newFromText( $opts->getValue( 'page' ) 
);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I77e1e59d7e3666802d0eeb0c48a0ec211dba0a2a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to