From: Brion Vibber Date: Wed, 15 Oct 2008 20:57:02 +0000 (+0000) Subject: Pulling out r42105 for now -- "Added 2 hooks. One in Parser to allow custom handling... X-Git-Tag: 1.31.0-rc.0~44734 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=2b8a8b262481372ea2c4320487af5216b9799959;p=lhc%2Fweb%2Fwiklou.git Pulling out r42105 for now -- "Added 2 hooks. One in Parser to allow custom handling of namespace links, and one in EditPage, to allow custom output/handling when a user has no edit rights" The namespace parsing thing feels very hacky and grabs bits out of an internal implementation function which doesn't feel like a stable interface. Would recommend thinking about this and coming up with a more serious stable interface for it. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6574a8b730..9e5a780343 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -164,11 +164,6 @@ The following extensions are migrated into MediaWiki 1.14: several uses of the same image. * (bug 1250) Users can still use "show preview" and "show changes" even if the wiki is set to read-only mode. -* Added 'ParserLinkNSCheck' hook in the parser, allowing extensions to catch and handle - links based on namespace (for instance, to add code to handle [[Tag: Foo]] similarly - to how [[Category: Foo]] is handled. -* Added 'EditPageNoPermission' hook to allow special handling/output when a non-editor - views an edit page. * Added a call to the 'UnwatchArticleComplete' hook to the watchlist editor. This should make it so that ALL user-accessible methods of removing a page from a watchlist lead to this hook being called (it was previously only called from within Article.php diff --git a/docs/hooks.txt b/docs/hooks.txt index 5209796f73..7cab7561b2 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -492,15 +492,6 @@ rendered inline in wiki pages or galleries in category pages. &$skip: skip this template and link it? &$id: the id of the revision being parsed -'ParserLinkNSCheck': after Image and Category links are handled, before general link processing -Allows an extension to catch arbitrary namespaces and hande their links differently -&$parser: the parser instance -&$title: The title instance -&$s: The current value of s, as used in replaceInternalLinks2 -&$text: The text of the link -&$prefix:The bit of text just before the link begins, depending on language settings -&$trail: The bit of text after the link ends, depending on language settings - 'BeforeParserMakeImageLinkObj': before an image is rendered by Parser &$parser: Parser object &$nt: the image title @@ -596,10 +587,6 @@ $text: content of the edit box $error: error message to return $summary: Edit summary for page -'EditPageNoPermission': allows modification of permission Errors before the readonly page is loaded -&$editpage: The editpage instance -&$permErrors: the permission Errors from editpage->getEditPermissionErrors() - 'EditFormPreloadText': Allows population of the edit form when creating new pages &$text: Text to preload with &$title: Title object representing the page being created diff --git a/includes/EditPage.php b/includes/EditPage.php index 963969741f..be4dee1b19 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -385,7 +385,6 @@ class EditPage { $permErrors = $this->getEditPermissionErrors(); if ( $permErrors ) { wfDebug( __METHOD__.": User can't edit\n" ); - wfRunHooks( 'EditPageNoPermission', array( &$this, &$permErrors ) ); $this->readOnlyPage( $this->getContent(), true, $permErrors, 'edit' ); wfProfileOut( __METHOD__ ); return; diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 7070be609d..0021e98416 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1801,10 +1801,6 @@ class Parser wfProfileOut( __METHOD__."-category" ); continue; } - # Give extensions a chance to catch other namespace links - if ( !wfRunHooks( 'ParserLinkNSCheck', array( &$this, &$nt, &$s, &$text, &$prefix, &$trail ) ) ) { - continue; - } } # Self-link checking