r55886 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55885‎ | r55886 | r55887 >
Date:15:55, 6 September 2009
Author:mkroetzsch
Status:deferred
Tags:
Comment:
remove support for <ask> query syntax (issue a message for now, but probably this will just be removed for SMW 1.5; this syntax undocumented since at least 2 years)
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php
@@ -189,19 +189,12 @@
190190
191191 /**
192192 * The \<ask\> parser hook processing part. This has been replaced by the
193 - * parser function \#ask and should no longer be used.
 193+ * parser function \#ask and is no longer supported.
 194+ * @todo Remove this function entirely, one could have an extension for those who
 195+ * wish to have some intelligent behaviour here.
194196 */
195197 static public function doAskHook($querytext, $params, &$parser) {
196 - global $smwgQEnabled, $smwgIQRunningNumber;
197 - if ($smwgQEnabled) {
198 - $smwgIQRunningNumber++;
199 - $result = SMWQueryProcessor::getResultFromHookParams($querytext,$params,SMW_OUTPUT_HTML);
200 - } else {
201 - wfLoadExtensionMessages('SemanticMediaWiki');
202 - $result = smwfEncodeMessages(array(wfMsgForContent('smw_iq_disabled')));
203 - }
204 - SMWOutputs::commitToParser($parser);
205 - return $result;
 198+ return '&lt;ask&gt; no longer supported. See SMW documentation on how to do inline queries now.';
206199 }
207200
208201 /**
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php
@@ -255,27 +255,6 @@
256256 }
257257
258258 /**
259 - * Process and answer a query as given by a string and an array of parameters
260 - * as is typically produced by the <ask> parser hook. The result is formatted
261 - * according to the specified $outputformat. The parameter $context defines in
262 - * what context the query is used, which affects certain general settings.
263 - */
264 - static public function getResultFromHookParams($querystring, $params, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY) {
265 - global $wgParser;
266 - $title = $wgParser->getTitle();
267 - if ($title === NULL) { // try that in emergency, needed in 1.11 in Special:Ask
268 - global $wgTitle;
269 - $title = $wgTitle;
270 - }
271 - // Take care at least of some templates -- for better template support use #ask
272 - $parser = new Parser();
273 - $parserOptions = new ParserOptions();
274 - $parser->startExternalParse( $title, $parserOptions, OT_HTML );
275 - $querystring = $parser->transformMsg( $querystring, $parserOptions );
276 - return SMWQueryProcessor::getResultFromQueryString($querystring, $params, array(), $outputmode, $context);
277 - }
278 -
279 - /**
280259 * Process a query string in SMW's query language and return a formatted
281260 * result set as HTML text. A parameter array of key-value-pairs constrains
282261 * the query and determines the serialisation mode for results. The parameter

Status & tagging log