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 = WikiPage::factory($t); $p->doEdit('my text', 'my comment'); return 'foo'; }
The doEdit always succeeds (based on its return Status). But somewhere later, as the parser tag renders, the following error always gets thrown:
Invalid marker: UNIQ586469ef5f8b5a1a-whatever-00000000-QINU
Backtrace:
#0 /var/www/html/w/includes/parser/StripState.php(66): StripState->addItem('general', 'UNIQ586469ef5f...', 'foo') #1 /var/www/html/w/includes/parser/Parser.php(3844): StripState->addGeneral('UNIQ586469ef5f...', 'foo') #2 /var/www/html/w/includes/parser/Preprocessor_DOM.php(1150): Parser->extensionSubstitution(Array, Object(PPFrame_DOM)) #3 /var/www/html/w/includes/parser/Parser.php(3038): PPFrame_DOM->expand(Object(PPNode_DOM), 0) #4 /var/www/html/w/includes/parser/Parser.php(1136): Parser->replaceVariables('<whatever/>') #5 /var/www/html/w/includes/parser/Parser.php(370): Parser->internalParse('<whatever/>') #6 /var/www/html/w/includes/WikiPage.php(3110): Parser->parse('<whatever/>', Object(Title), Object(ParserOptions), true, true, 1429350) #7 /var/www/html/w/includes/PoolCounter.php(209): PoolWorkArticleView->doWork() #8 /var/www/html/w/includes/Article.php(631): PoolCounterWork->execute() #9 /var/www/html/w/includes/actions/ViewAction.php(37): Article->view() #10 /var/www/html/w/includes/Wiki.php(427): ViewAction->show() #11 /var/www/html/w/includes/Wiki.php(304): MediaWiki->performAction(Object(Article)) #12 /var/www/html/w/includes/Wiki.php(536): MediaWiki->performRequest() #13 /var/www/html/w/includes/Wiki.php(446): MediaWiki->main() #14 /var/www/html/w/index.php(75): MediaWiki->run() #15 {main}
So I am wondering: is it dangerous to call doEdit inside a parser tag's callback? Is there another way to make a parser tag create an article? This is MediaWiki 1.20. Thank you, DanB