2009/5/2 Adam Nielsen <[email protected]>: > Hi all, > > I've just started on a MediaWiki extension that uses the MW API for > bulk-editing articles. Unfortunately for some reason after making the call to > edit the pages, instead of the browser seeing whatever I have written with > $wgOut->addHTML(), the browser gets redirected to the last page that was > edited. > > This is the code I am using to perform the edit, where $p is a result returned > from a previous Query API call (to get the list of pages that need editing.) > > $req = new FauxRequest(array( > 'action' => 'edit', > 'bot' => true, > 'token' => $p['edittoken'], > 'title' => $p['title'], > 'summary' => $this->strSummary, > 'text' => $newContent, > 'basetimestamp' => $p['starttimestamp'] > ), true); > $processor = new ApiMain($req, true); > $processor->execute(); > > If I comment out the execute() line then I see my summary Special page, but > with execute() present I get pushed onto the last article edited instead > (although every edit does go through successfully.) The other API call (for > querying the page content) works fine, it's only the Edit call that seems to > exhibit this behaviour. > > Does anyone have any idea what's going on here? I'm running MW 1.14.0. > This is a consequence of the lack of separation between DB and UI logic in EditPage.php . Until EditPage.php is drastically rewritten, I'm afraid calling action=edit internally is just not going to work :(
Roan Kattouw (Catrope) _______________________________________________ Mediawiki-api mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
