API is intended for bots, not humans. Making it accept anon edits just allows bots to edit accidentally logged off. And the AssertEdit extension doesn't seem to work for API. What can be done about this?
Simply adding an AlternateEdit hook call to ApiEditPage leads to ugly HTML output.
Max Semenik managed to write:
API is intended for bots, not humans. Making it accept anon edits just allows bots to edit accidentally logged off. And the AssertEdit extension doesn't seem to work for API. What can be done about this?
Simply adding an AlternateEdit hook call to ApiEditPage leads to ugly HTML output.
I thought about assertions in API. I'll add them this week. --VasilievVV
On 25.05.2008, 10:52 VasilievVV wrote:
Max Semenik managed to write:
API is intended for bots, not humans. Making it accept anon edits just allows bots to edit accidentally logged off. And the AssertEdit extension doesn't seem to work for API. What can be done about this?
Simply adding an AlternateEdit hook call to ApiEditPage leads to ugly HTML output.
I thought about assertions in API. I'll add them this week. --VasilievVV
This hook was implemented by Bryan Tong Minh in 35294[1], and in conjunction wit AssertEdit it leads, as I warned, to AssertEdit attempting to display a HTML error page and choking with "Fatal error: Call to a member function getPrefixedText() on a non-object in C:\Projects\MediaWiki\includes\OutputPage.php on line 1314" instead of proper XML output. I suppose that other extensions that don't expect to be called from API may exhibit the same behaviour.
---- [1] http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=35294
On Sun, May 25, 2008 at 11:48 AM, Max Semenik maxsem.wiki@gmail.com wrote:
On 25.05.2008, 10:52 VasilievVV wrote:
Max Semenik managed to write:
API is intended for bots, not humans. Making it accept anon edits just allows bots to edit accidentally logged off. And the AssertEdit extension doesn't seem to work for API. What can be done about this?
Simply adding an AlternateEdit hook call to ApiEditPage leads to ugly HTML output.
I thought about assertions in API. I'll add them this week. --VasilievVV
This hook was implemented by Bryan Tong Minh in 35294[1], and in conjunction wit AssertEdit it leads, as I warned, to AssertEdit attempting to display a HTML error page and choking with "Fatal error: Call to a member function getPrefixedText() on a non-object in C:\Projects\MediaWiki\includes\OutputPage.php on line 1314" instead of proper XML output. I suppose that other extensions that don't expect to be called from API may exhibit the same behaviour.
[1] http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=35294
-- Best regards, Max Semenik ([[User:MaxSem]])
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
I think I added that hook on the wrong place. It should probably somewhere after the title has been set.
Bryan
On Sun, May 25, 2008 at 6:53 PM, Bryan Tong Minh bryan.tongminh@gmail.com wrote:
On Sun, May 25, 2008 at 11:48 AM, Max Semenik maxsem.wiki@gmail.com wrote:
On 25.05.2008, 10:52 VasilievVV wrote:
Max Semenik managed to write:
API is intended for bots, not humans. Making it accept anon edits just allows bots to edit accidentally logged off. And the AssertEdit extension doesn't seem to work for API. What can be done about this?
Simply adding an AlternateEdit hook call to ApiEditPage leads to ugly HTML output.
I thought about assertions in API. I'll add them this week. --VasilievVV
This hook was implemented by Bryan Tong Minh in 35294[1], and in conjunction wit AssertEdit it leads, as I warned, to AssertEdit attempting to display a HTML error page and choking with "Fatal error: Call to a member function getPrefixedText() on a non-object in C:\Projects\MediaWiki\includes\OutputPage.php on line 1314" instead of proper XML output. I suppose that other extensions that don't expect to be called from API may exhibit the same behaviour.
[1] http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=35294
-- Best regards, Max Semenik ([[User:MaxSem]])
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
I think I added that hook on the wrong place. It should probably somewhere after the title has been set.
Bryan
...or not. It appears that the error occurs because $wgTitle is not set. It should probably be set to something sensible or $wgOut should be set to a fake object that does nothing.
Bryan
Bryan Tong Minh schreef:
...or not. It appears that the error occurs because $wgTitle is not set. It should probably be set to something sensible or $wgOut should be set to a fake object that does nothing.
$wgOut->disable(); in api.php should work.
Roan Kattouw (Catrope)
Please correct me if I'm wrong, but I don't think it's a good idea to assume that API is only for bots - after all bot can use API on behalf of the user and use their credentials (or lack of them). API definitely has JSON implementation and can be used in GUI elements that are available to users as much as for bots.
Sergey
Sergey Chernyshev schreef:
Please correct me if I'm wrong, but I don't think it's a good idea to assume that API is only for bots - after all bot can use API on behalf of the user and use their credentials (or lack of them). API definitely has JSON implementation and can be used in GUI elements that are available to users as much as for bots.
Exactly. It should also be considered, that just because *we* think something is stupid or useless, a wiki admin may disagree. I'm gonna add the 'writeapi' right right now.
Roan Kattouw (Catrope)
mediawiki-api@lists.wikimedia.org