r71454 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71453‎ | r71454 | r71455 >
Date:23:19, 22 August 2010
Author:jeroendedauw
Status:resolved (Comments)
Tags:
Comment:
Changes for 0.6.6 - fixed bug in parsing of popup contents
Modified paths:
  • /trunk/extensions/Maps/Features/DisplayPoint/Maps_BasePointMap.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Features/DisplayPoint/Maps_BasePointMap.php
@@ -167,9 +167,14 @@
168168 * Fills the $markerData array with the locations and their meta data.
169169 */
170170 private function setMarkerData() {
171 - $this->title = $this->parser->recursiveTagParse( $this->title );
172 - $this->label = $this->parser->recursiveTagParse( $this->label );
 171+ global $wgTitle;
173172
 173+ // New parser object to render popup contents with.
 174+ $parser = new Parser();
 175+
 176+ $this->title = $parser->parse( $this->title, $wgTitle, new ParserOptions() )->getText();
 177+ $this->label = $parser->parse( $this->label, $wgTitle, new ParserOptions() )->getText();
 178+
174179 // Each $args is an array containg the coordinate set as first element, possibly followed by meta data.
175180 foreach ( $this->coordinates as $args ) {
176181 $markerData = MapsCoordinateParser::parseCoordinates( array_shift( $args ) );
@@ -178,11 +183,11 @@
179184
180185 if ( count( $args ) > 0 ) {
181186 // Parse and add the point specific title if it's present.
182 - $markerData['title'] = $this->parser->recursiveTagParse( $args[0] );
 187+ $markerData['title'] = $parser->parse( $args[0], $wgTitle, new ParserOptions() )->getText();
183188
184189 if ( count( $args ) > 1 ) {
185190 // Parse and add the point specific label if it's present.
186 - $markerData['label'] = $this->parser->recursiveTagParse( $args[1] );
 191+ $markerData['label'] = $parser->parse( $args[1], $wgTitle, new ParserOptions() )->getText();
187192
188193 if ( count( $args ) > 2 ) {
189194 // Add the point specific icon if it's present.

Comments

#Comment by Nikerabbit (talk | contribs)   09:00, 9 February 2011

Causes fatal errors: bug 27272

#Comment by Jeroen De Dauw (talk | contribs)   13:42, 9 February 2011

I made this change since links where getting omitted before. I just had a go at fixing this, but it looks like a correct fix is not really possible without making significant changes to the code.

You can try replacing $wgTitle by New Title() - ugly hack, but if it works, then it works; I'm rewriting the code anyway on a branch.

Status & tagging log