[Wikitech-l] Is WikiPage-doEdit dangerous in a parser tag callback?

2013-10-11 Thread Daniel Barrett
Is it dangerous to call WikiPage-doEdit inside a parser tag callback? I'm writing a parser tag extension whatever, whose callback function is: public static function myCallback($input, $argv, $parser) { $t = Title::newFromText('anytitle'); // any article title at all $p =

Re: [Wikitech-l] Is WikiPage-doEdit dangerous in a parser tag callback?

2013-10-11 Thread Aaron Schulz
The doEdit() call needs to parse and reuses $wgParser, which is already in use so it probably breaks the state of it. Maybe you could use a DeferredUpdate to actually to the edits, or do them via an api.php request, or stash $wgParser, replace it with a new one before doing the edit and then swap

Re: [Wikitech-l] Is WikiPage-doEdit dangerous in a parser tag callback?

2013-10-11 Thread Brian Wolff
On 2013-10-11 1:24 PM, Aaron Schulz aschulz4...@gmail.com wrote: The doEdit() call needs to parse and reuses $wgParser, which is already in use so it probably breaks the state of it. Maybe you could use a DeferredUpdate to actually to the edits, or do them via an api.php request, or stash

Re: [Wikitech-l] Is WikiPage-doEdit dangerous in a parser tag callback?

2013-10-11 Thread Daniel Barrett
Thanks for your suggestion! I wound up deferring the edits by adding them to the MediaWiki job queue. DanB ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l