Last modified: 2007-04-25 21:38:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T11697, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9697 - Adding InternalParseBeforeLinks Parser Hook for Semantic MediaWiki
Adding InternalParseBeforeLinks Parser Hook for Semantic MediaWiki
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-25 20:07 UTC by Jim R. Wilson
Modified: 2007-04-25 21:38 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch to add hook + documentation (561 bytes, patch)
2007-04-25 20:10 UTC, Jim R. Wilson
Details
Patch to add hook (1.22 KB, patch)
2007-04-25 20:41 UTC, Jim R. Wilson
Details
Patch to add hook with all three params + hooks.txt and RELEASE-NOTES updates (1.71 KB, patch)
2007-04-25 20:59 UTC, Jim R. Wilson
Details

Description Jim R. Wilson 2007-04-25 20:07:50 UTC
As per the instructions in Semantic's INSTALL file:

Edit the file [wikipath]/includes/Parser.php. Insert the line
  wfRunHooks( 'InternalParseBeforeLinks', array( &$this, &$text, null ) );
in the method "internalParse" right after the line
  $text = $this->replaceVariables( $text, $args );

This is the only hack required for full functionality of Semantic MW -
everything else is already achievable with existing hooks.

I will attach a patch shortly (from revision 20529).
Comment 1 Jim R. Wilson 2007-04-25 20:10:48 UTC
Created attachment 3525 [details]
Patch to add hook + documentation

Adds InternalParseBeforeLinks as per Semantic's INSTALL instructions.
Comment 2 Jim R. Wilson 2007-04-25 20:40:50 UTC
Comment on attachment 3525 [details]
Patch to add hook + documentation

Index: docs/hooks.txt
===================================================================
--- docs/hooks.txt	(revision 20529)
+++ docs/hooks.txt	(working copy)
@@ -388,6 +388,12 @@
 $url: string value as output (out parameter, can modify)
 $query: query options passed to Title::getFullURL()

+'InternalParseBeforeLinks': during Parser's internalParse method before links
but
+after noinclude/includeonly/onlyinclude and other processing.
+&$this: Parser object
+&$text: string containing partially parsed text
+&$this->mStripState: Parser's internal StripState object
+
 'LogPageValidTypes': action being logged. DEPRECATED: Use $wgLogTypes
 &$type: array of strings

Index: includes/Parser.php
===================================================================
--- includes/Parser.php (revision 20529)
+++ includes/Parser.php (working copy)
@@ -1000,6 +1000,7 @@
		$text = Sanitizer::removeHTMLtags( $text, array( &$this,
'attributeStripCallback' ) );

		$text = $this->replaceVariables( $text, $args );
+		wfRunHooks( 'InternalParseBeforeLinks', array( &$this, &$text,
&$this->mStripState ) );

		// Tables need to come after variable replacement for things to
work
		// properly; putting them before other transformations should
keep
Comment 3 Jim R. Wilson 2007-04-25 20:41:31 UTC
Created attachment 3526 [details]
Patch to add hook

Better patch - now adds documentation in docs/hooks.txt
Comment 4 Jim R. Wilson 2007-04-25 20:59:21 UTC
Created attachment 3527 [details]
Patch to add hook with all three params + hooks.txt and RELEASE-NOTES updates

Thanks in advance to the dev that can commit this. :)
Comment 5 Jim R. Wilson 2007-04-25 21:38:56 UTC
Fixed in rev 21592

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links