Reedy has submitted this change and it was merged.

Change subject: Add $context to the ArticleFromTitle hook
......................................................................


Add $context to the ArticleFromTitle hook

Most of the time people wouldn't need this - this hook is mostly
used to inject a custom Article subclass for a specific
namespace to do fancy things, but lets give users the most
flexibility.

Asked for by leaves on irc.

Change-Id: I3386ff4abe0e5b3eb783604ae222b7703428db44
---
M docs/hooks.txt
M includes/Article.php
2 files changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Reedy: Verified; Looks good to me, approved



diff --git a/docs/hooks.txt b/docs/hooks.txt
index 3f1152b..4a43359 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -541,6 +541,7 @@
 Wiki::articleFromTitle().
 $title: Title (object) used to create the article object
 $article: Article (object) that will be returned
+$context: IContextSource (object)
 
 'ArticleInsertComplete': After a new article is created. DEPRECATED, use
 PageContentInsertComplete.
diff --git a/includes/Article.php b/includes/Article.php
index 85a34db..e0396a1 100644
--- a/includes/Article.php
+++ b/includes/Article.php
@@ -158,7 +158,7 @@
                }
 
                $page = null;
-               wfRunHooks( 'ArticleFromTitle', array( &$title, &$page ) );
+               wfRunHooks( 'ArticleFromTitle', array( &$title, &$page, 
$context ) );
                if ( !$page ) {
                        switch ( $title->getNamespace() ) {
                                case NS_FILE:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3386ff4abe0e5b3eb783604ae222b7703428db44
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to