Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_RSSlink.php |
— | — | @@ -198,7 +198,7 @@ |
199 | 199 | * Creates the RSS output for the single item. |
200 | 200 | */ |
201 | 201 | public function text() { |
202 | | - global $wgTitle, $wgServer, $wgParser, $smwgStoreActive, $smwgRSSWithPages; |
| 202 | + global $wgServer, $wgParser, $smwgStoreActive, $smwgRSSWithPages; |
203 | 203 | static $parser = null; |
204 | 204 | static $parser_options = null; |
205 | 205 | $smwgStoreActive = false; // make sure no Factbox is shown (RSS lacks the required styles) |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_Embedded.php |
— | — | @@ -38,12 +38,18 @@ |
39 | 39 | |
40 | 40 | protected function getResultText($res,$outputmode) { |
41 | 41 | // handle factbox |
42 | | - global $smwgStoreActive, $wgTitle, $smwgEmbeddingList, $wgParser; |
| 42 | + global $smwgStoreActive, $smwgEmbeddingList, $wgParser; |
43 | 43 | $old_smwgStoreActive = $smwgStoreActive; |
| 44 | + $title = $wgParser->getTitle(); |
| 45 | + if ($title === NULL) { // try that in emergency, needed in 1.11 in Special:Ask |
| 46 | + global $wgTitle; |
| 47 | + $title = $wgTitle; |
| 48 | + } |
| 49 | + |
44 | 50 | $smwgStoreActive = false; // no annotations stored, no factbox printed |
45 | 51 | if (!isset($smwgEmbeddingList)) { // used to catch recursions, sometimes more restrictive than needed, but no major use cases should be affected by that! |
46 | | - $smwgEmbeddingList = array($wgTitle); |
47 | | - $oldEmbeddingList = array($wgTitle); |
| 52 | + $smwgEmbeddingList = array($title); |
| 53 | + $oldEmbeddingList = array($title); |
48 | 54 | } else { |
49 | 55 | $oldEmbeddingList = array_values($smwgEmbeddingList); |
50 | 56 | } |
— | — | @@ -93,9 +99,9 @@ |
94 | 100 | } |
95 | 101 | if ($outputmode == SMW_OUTPUT_WIKI) { |
96 | 102 | // $result .= '{{' . $articlename . '}}'; // fails in MW1.12 and later |
97 | | - $result .= '[[SMW::off]]' . $parser->preprocess('{{' . $articlename . '}}', $wgTitle, $parser_options) . '[[SMW::on]]'; |
| 103 | + $result .= '[[SMW::off]]' . $parser->preprocess('{{' . $articlename . '}}', $title, $parser_options) . '[[SMW::on]]'; |
98 | 104 | } else { // SMW_OUTPUT_HTML, SMW_OUTPUT_FILE |
99 | | - $parserOutput = $parser->parse('[[SMW::off]]{{' . $articlename . '}}[[SMW::on]]', $wgTitle, $parser_options); |
| 105 | + $parserOutput = $parser->parse('[[SMW::off]]{{' . $articlename . '}}[[SMW::on]]', $title, $parser_options); |
100 | 106 | $result .= $parserOutput->getText(); |
101 | 107 | } |
102 | 108 | } else { |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php |
— | — | @@ -225,14 +225,19 @@ |
226 | 226 | * Process and answer a query as given by a string and an array of parameters |
227 | 227 | * as is typically produced by the <ask> parser hook. The result is formatted |
228 | 228 | * according to the specified $outputformat. The parameter $context defines in |
229 | | - * what context the query is used, which affects ceretain general settings. |
| 229 | + * what context the query is used, which affects certain general settings. |
230 | 230 | */ |
231 | 231 | static public function getResultFromHookParams($querystring, $params, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY) { |
232 | | - global $wgTitle; |
| 232 | + global $wgParser; |
| 233 | + $title = $wgParser->getTitle(); |
| 234 | + if ($title === NULL) { // try that in emergency, needed in 1.11 in Special:Ask |
| 235 | + global $wgTitle; |
| 236 | + $title = $wgTitle; |
| 237 | + } |
233 | 238 | // Take care at least of some templates -- for better template support use #ask |
234 | 239 | $parser = new Parser(); |
235 | 240 | $parserOptions = new ParserOptions(); |
236 | | - $parser->startExternalParse( $wgTitle, $parserOptions, OT_HTML ); |
| 241 | + $parser->startExternalParse( $title, $parserOptions, OT_HTML ); |
237 | 242 | $querystring = $parser->transformMsg( $querystring, $parserOptions ); |
238 | 243 | return SMWQueryProcessor::getResultFromQueryString($querystring, $params, array(), $outputmode, $context); |
239 | 244 | } |