r84085 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84084‎ | r84085 | r84086 >
Date:11:03, 16 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fixing bug 27272
Modified paths:
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php
@@ -243,14 +243,14 @@
244244 * @since 0.7
245245 */
246246 protected function addStaticLocations() {
247 - global $wgTitle;
 247+ global $wgParser;
248248
249249 // New parser object to render popup contents with.
250 - $parser = new Parser();
 250+ $parser = clone $wgParser;
 251+
 252+ $this->title = $parser->parse( $this->title, $parser->getTitle(), new ParserOptions() )->getText();
 253+ $this->label = $parser->parse( $this->label, $parser->getTitle(), new ParserOptions() )->getText();
251254
252 - $this->title = $parser->parse( $this->title, $wgTitle, new ParserOptions() )->getText();
253 - $this->label = $parser->parse( $this->label, $wgTitle, new ParserOptions() )->getText();
254 -
255255 // Each $location is an array containg the coordinate set as first element, possibly followed by meta data.
256256 foreach ( $this->staticlocations as $location ) {
257257 $markerData = MapsCoordinateParser::parseCoordinates( array_shift( $location ) );
@@ -261,11 +261,11 @@
262262
263263 if ( count( $location ) > 0 ) {
264264 // Parse and add the point specific title if it's present.
265 - $markerData['title'] = $parser->parse( $location[0], $wgTitle, new ParserOptions() )->getText();
 265+ $markerData['title'] = $parser->parse( $location[0], $parser->getTitle(), new ParserOptions() )->getText();
266266
267267 if ( count( $location ) > 1 ) {
268268 // Parse and add the point specific label if it's present.
269 - $markerData['label'] = $parser->parse( $location[1], $wgTitle, new ParserOptions() )->getText();
 269+ $markerData['label'] = $parser->parse( $location[1], $parser->getTitle(), new ParserOptions() )->getText();
270270
271271 if ( count( $location ) > 2 ) {
272272 // Add the point specific icon if it's present.
@@ -307,7 +307,7 @@
308308 * @param array $row The record you want to add data from
309309 */
310310 protected function addResultRow( $outputmode, array $row ) {
311 - global $wgUser, $smgUseSpatialExtensions, $wgTitle;
 311+ global $wgUser, $smgUseSpatialExtensions;
312312
313313 $skin = $wgUser->getSkin();
314314
@@ -354,7 +354,8 @@
355355
356356 if ( $this->template ) {
357357 // New parser object to render the templates with.
358 - $parser = new Parser();
 358+ global $wgParser;
 359+ $parser = clone $wgParser;
359360 }
360361
361362 foreach ( $coords as $coord ) {
@@ -375,7 +376,7 @@
376377 $label
377378 );
378379
379 - $text = $parser->parse( '{{' . implode( '|', $segments ) . '}}', $wgTitle, new ParserOptions() )->getText();
 380+ $text = $parser->parse( '{{' . implode( '|', $segments ) . '}}', $parser->getTitle(), new ParserOptions() )->getText();
380381 }
381382
382383 $this->locations[] = array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r84086follow up to r84085jeroendedauw11:19, 16 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84084fixing bug 27272jeroendedauw11:03, 16 March 2011

Status & tagging log