From 4e6298f8810f097dbdddcae337f0b4a91a5ce5ff Mon Sep 17 00:00:00 2001 From: idradm Date: Wed, 3 Jun 2015 13:40:26 +0200 Subject: [PATCH] DAT-2866 citation error wont be showing up when partial parse is run --- services/Parser/MediaWikiParserService.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/services/Parser/MediaWikiParserService.php b/services/Parser/MediaWikiParserService.php index 9564cbc..60f87e7 100644 --- a/services/Parser/MediaWikiParserService.php +++ b/services/Parser/MediaWikiParserService.php @@ -23,10 +23,17 @@ class MediaWikiParserService implements ExternalParser { //fix for first item list elements $wikitext = "\n" . $wikitext; } - $parsedText = $this->parser->parse( $wikitext, $this->getParserTitle(), $this->getParserOptions(), - false, false )->getText(); + //save current options state, as it'll be overridden by new instance when parse is invoked + $options = $this->getParserOptions(); + $tmpOptions = clone $options; + $tmpOptions->setIsPartialParse( true ); + + $output = $this->parser->parse( $wikitext, $this->getParserTitle(), $tmpOptions, false, false )->getText(); + //restore options state + $this->parser->Options( $options ); + wfProfileOut( __METHOD__ ); - return $parsedText; + return $output; } /**