https://bugzilla.wikimedia.org/show_bug.cgi?id=17784
--- Comment #4 from Roan Kattouw <[email protected]> 2009-03-10 18:32:38 UTC --- (In reply to comment #2) > Actually, I checked that, and what happens, is that when the Semantic > MediaWiki > processor runs in "count" mode, the resutl of getQueryResult is an string with > the > result of the count, not a SMWQueryResult object. Might be broken - but it's > broken > inside SMW. > Right... So much for intuitive behavior :) > > Note that this code only works with MediaWiki 1.15alpha; 1.14 and earlier > > versions don't have the setIndexedTagName_internal() method. > > > I need this code to work in 1.14 and eaerlier (we currently use 1.13.5). I'd > really appreciate > any points on how to properly write it so it will work in both 1.13 and 1.15? > > It could be really great if you could give me some pointers as to how to do > this properly. > You probably want to check that with method_exists($this->getResult(), 'setIndexedTagName_internal') . If that returns true, you can (and should) use the 'new' way of adding results. > > You should use > > $wgParser->preprocess() instead, though, since transformMsg() uses $wgTitle > > (which is null, which'll probably cause nasty errors). > > > From what I've read in the comments, I'm supposed to use transformMsg from the > outside of the parser. preprocess() can also be called from outside the parser, AFAICT. > And without ParserOptions, the function doesn't work. Also, preprocess() > expects a $title as well. You can provide an empty ParserOptions object and a suitable title object (no idea what's suitable in this context), like this: global $wgParser; $title = Title::newFromText("Whatever"); // Or whatever you need to get a suitable Title return $wgParser->preprocess($query, $title, new ParserOptions > I changed the prefix instead, indeed. I think asksortorder doesn't look as > good > - but if it's against the naming convention I can change that. > It's not a big deal, it's just that no other module uses underscores, so it looked kind of weird to me. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
