Last modified: 2012-01-05 01:41:39 UTC
I think there should be a parameter for the 'SMWResultPrinter' class constructor to pass the parser object of the rendering process the result printing is a part of. Right now there is $wgParser being used in a few places within 'SMWResultPrinter' class. We also have specific result formats making use of $wgParser and at least within (SRFs) 'Array' and 'Hash' formats I know for sure that this could lead to some ugly bugs under special circumstances. One such case would be for example special page transclusion where the query printer is being used within that special page - in that case $wgParser does not point to the special pages Parser object!
I fully agree, as I have had a lot of bugs related to this in the Semantic Maps extension and although the code that is there now works (as far as I can tell), it's not nice and prone to breaking. If you want to have a go at adding in a parser object, please do. (I'd be happy to review your changes.) I first want to have a 1.7.1 release though, so it's probably best to do this on a branch or wait for trunk to go to 1.8 alpha. A somewhat related change that should also be done at some point is making use of the requestContext stuff introduced in MW 1.18, but we'll have to wait for SMW 1.9 (ie a year or so) before we can do this.