Manual talk:Hooks/ParserGetVariableValueSwitch

Hook execution question
I am using Mediawiki 1.11.1 and I have a problem with the following sentences in the text:


 * Otherwise it does nothing and returns . Returning   tells MediaWiki to go onto the remaining hooks assigned to ParserGetVariableValueSwitch in hopes of finding a value for the magic word id.

From the tests that I have performed it seems instead that if there are several hooks the execution of the hooks is interrupted as soon as one of them returns. It is when a hook returns  that the execution continues to the next hook. Is it an error in the text or have I misunderstood something? &mdash; Tommy Ekola 12:06, 26 February 2008 (UTC)


 * When returning false  will abort and won't call any other functions registered for the hook. BUT in   where the hook is being called you find the lines


 * so only if true was returned, any value is assigned to the variables value. I consider this a bug.  should be  . Then we could return false to signal that a value has been found (and improve performance!) by returning false. Though, all extensions doing so would break compatibility with MW versions before the bugfix (of course except this worked with any old MW versions, I discovered this in MW 1.17).


 * Conclusion: Always return true unless the bug is being fixed and you only want to develop for MW in the version of that bugfix and later. --Danwe 16:43, 8 November 2011 (UTC)


 * Also see --Danwe 17:01, 8 November 2011 (UTC)

return Links
Hi, when I do something like $ret='&lt;div style="border:1px solid black"&gt;txt&lt;/div&gt;'; a box is rendered. When I return $ret='&lt;a href="http://mysite/index.htm"&gt;Index&lt;/a&gt;'; no link is rendered, but the HTML code is shown. Is it possible to generate a link with this technique? -- Bardnet 11:58, 28 May 2008 (UTC)