Last modified: 2009-05-26 06:03:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T20920, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18920 - Wikimedia error from POST
Wikimedia error from POST
Status: RESOLVED DUPLICATE of bug 10733
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.15.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-25 22:02 UTC by Janusz 'Ency' Dorozynski
Modified: 2009-05-26 06:03 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
response from Wikibot (58.76 KB, text/html)
2009-05-25 22:02 UTC, Janusz 'Ency' Dorozynski
Details

Description Janusz 'Ency' Dorozynski 2009-05-25 22:02:00 UTC
Created attachment 6153 [details]
response from Wikibot

I use Wikibot (http://en.wikipedia.org/wiki/User:LivingBot/Wikibot.php5) in my script Test.php:

<source lang="php">
<?php
  //grab class
  include('Wikibot.php5');
  //get user&password
  $fhUP = fopen("user&password.txt", 'r') or die("Can't open user&password file");
  $username = rtrim(fgets($fhUP));
  $password = rtrim(fgets($fhUP));
  fclose($fhUP);
  // open file with page names
  $fhPN = fopen("page_names.txt", 'r') or die("Can't open page_names file");  
  //create bot
  $wiki = "en";
  $MyBot = new Wikibot($username, $password, $wiki);
  // get first page
  $pagename = rtrim(fgets($fhPN));
  // process page names
  $i = 0;
  echo "\n";    
  while (!feof($fhPN)) 
  {
   echo "\nPage " . ++$i . " [[" . $wiki . ":" . $pagename . "]]\n";  
   $page = $MyBot->get_page($pagename);
   $out = $MyBot->edit_page($pagename,$page."<br><br>Test ".date("Y-m-d H:i:s"),"test",false,false);    
   // next page
   $pagename = rtrim(fgets($fhPN));
  }
  fclose($fhPN);
?>
</source>

File page_names.txt contains two lines: User:Ency/test1 and User:Ency/test2. Execute

# php Test.php 

gives right result with 1st page and for a while obscure with 2nd:

Page 1 [[en:User:Ency/test1]]
Successfully edited User:Ency/test1.<br />

Page 2 [[en:User:Ency/test2]]
Error - &nbsp;<br />
^^^ Error with put_page called from edit_page.<br />

I found that Wikibot in 221 line ($response = curl_exec($ch);) gives such $response for 1st page:

a:1:{s:4:"edit";a:5:s:6:"result";s:7:"Success";s:6:"pageid";i:22950702;s:5:"title";s:15:"User:Ency/test1";s:8:"oldrevid";i:292303690;s:8:"newrevid";i:292303840;}}

and for 2nd only html standard error page (see attachment 2 [details]nd_response.html), which is returned after unserialize as empty array.

Is it a API bug in 2nd case?
Comment 1 Roan Kattouw 2009-05-26 06:03:26 UTC

*** This bug has been marked as a duplicate of bug 10733 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links