Hi,
The idea of having it at the top of the function, and making it more comprehensive, makes sense; but I don't understand the specific code you suggested. My understanding is that wfRunHooks() normally returns true; in that case, if the call is placed at the top of the function, whatever value the hooks set the broken link to will get overridden by makeBrokenLinkObj() itself. Or is the idea that every function that uses this hook should return false, thus ensuring that no more than one function is called for it?
-Yaron
On Wed, Mar 5, 2008 at 11:31 AM, Simetrical Simetrical+wikilist@gmail.com wrote:
On Wed, Mar 5, 2008 at 10:51 AM, Yaron Koren yaron57@gmail.com wrote:
Around line 348, within makeBrokenLinkObj(), under the line:
$u = $nt->escapeLocalURL( $q );
there would be added added the following:
wfRunHooks( 'BrokenLink', array( $nt, $query, &$u ));
That's not very flexible, is it? It basically allows changing one thing, $u. Why don't you put it almost at the bottom, or almost at the top, and have it be
$ret = null; if( !wfRunHooks( 'BrokenLink', array( &$nt, &$text,
&$query, &$trail, &$prefix, &$ret ) ) ) { return $ret; }
If it's at the bottom, some other parameters might be passed, to avoid having to re-process everything. The top would maybe be better.
The name seems fine. Make sure you update docs/hooks.txt, whatever you do.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l