Commit graph

122 commits

Author SHA1 Message Date
Ryan Kaldari
7e903243c6 $reqArr is an ambiguous variable name - req can mean required or request. Changing to an unambiguous name 2011-12-20 04:22:06 +00:00
Ryan Kaldari
ac64223568 adding sectiontitle/wgSectionTitle as a new parameter for page editing (so that it can be set separately from the edit summary). For right now, this is just for API use, and thus isnt used in the form. As soon as 1.19 is out the door, we should change the form to use this as well. The current implementation is designed to be completely backward-compatible and non-disruptive 2011-12-20 04:15:21 +00:00
Sam Reed
b0818acd86 More example conversions/additions
Ping r106439
2011-12-17 19:10:33 +00:00
Sam Reed
53000baecf Oh noes, moar http:// -> https:// 2011-11-28 15:43:11 +00:00
Sam Reed
cd2d20fe8f Fix hook copy paste fail
Move rest of captcha params out of api/ApiEditPage.php
2011-11-23 20:37:13 +00:00
Sam Reed
93fd7aceb8 * (bug 32609) API: Move captchaid/captchaword of action=edit from core to Captcha extension(s)
Left setting of wpCaptchaId and wpCaptchaWord in core. Can't think of a sane way to check and set them via an extension (subclass and override, or a hook). Annoyingly APIEditBeforeSave doesn't pass the params array
2011-11-23 19:09:57 +00:00
Alexandre Emsenhuber
ee8bbf0be8 * Use the fact that WikiPage::getLatest() is updated when editing the page since r103383
* Moved override of $wgTitle and creation of EditPage object to the place they will be used
2011-11-17 10:33:20 +00:00
John Du Hart
2e7d867478 Removed the 'eclipse helper' bit on top of every API module
It's a parctice that dates back to 2006 when the API was first written, and frankly isn't covered by the coding conventions. Same thing with the docblocks, they're all copypasted with some bits changed and don't even make sense if you look at them in the genereated code docs.
I don't feel that any of us depend on this anymore (get a better IDE), so in the inerest of consistancy it's time we said goodbye to it.
2011-11-16 00:17:26 +00:00
Alexandre Emsenhuber
df4b6e4c3a Per Aaron, fix for r89405: introduced DerivativeRequest to allow to override the request parameters, but not headers, cookies and session. Updated ApiEditPage (for the bug) and ApiLogin (for future use) 2011-11-03 19:14:46 +00:00
John Du Hart
40f19e6def Adding context to the API
This will probably break something somewhere so when it does please yell at me on IRC and I'll fix it.
2011-10-26 23:27:01 +00:00
John Du Hart
d07e1d1a06 API get functions should be public 2011-08-26 22:56:31 +00:00
Roan Kattouw
5090af900c (bug 29246) Edit API occasionally throws "unknown error 231". Per comment #1 on the bug and a comment in ApiEditPage, I refactored internalAttemptSave() to return a status object. However, there are so many idiosyncracies wrt how EditPage handles various errors that I decided to put the AS_* error code in $status->value (thanks Chad for that tip) and use that to decide what to do (not part of Chad's tip). The resulting code is still a mess but at least Status objects from doEdit() are propagated now, and it'll be a little bit easier to migrate internalAttemptSave() to a proper Status-based architecture in the future. Or maybe we should just throw away EditPage and start with a blank screen, that sounds appealing to me :) 2011-08-26 16:26:17 +00:00
Sam Reed
a5628f5734 Based on diff to wikia, set more functions consistently public rather than protected 2011-08-17 22:24:21 +00:00
Mark A. Hershberger
48a8fd37ea tabs are tabs, not spaces 2011-07-28 19:13:58 +00:00
Sam Reed
6e84e9ccd9 Followup r92396, add help urls for most of the core (non query) modules 2011-07-17 16:38:24 +00:00
Sam Reed
7206e3cafe * (bug 29278) server error 500 when attempting to add text to a page via redirect (redirect points to the page and page is edited)
Needs 1.17 and 1.18 backporting, so release notes will go in 1.17
2011-06-20 22:32:08 +00:00
Sam Reed
834129ac75 Revert r90488, rename variable from r90487 2011-06-20 22:18:11 +00:00
Sam Reed
09e63f9f53 Followup r90487, kill $result=null in middle 2011-06-20 22:16:22 +00:00
Sam Reed
446d10c8d2 Define a local variable for $result 2011-06-20 22:13:45 +00:00
Sam Reed
bdf84cb20e Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits, so hopefully reviewable in CR...
2011-06-17 16:03:52 +00:00
Sam Reed
dbecd0b5f3 Related to bug 29278, and from the comments in bug 14210, mention the edit token should be sent last/after the text parameter 2011-06-17 14:55:03 +00:00
Sam Reed
58ccb663e1 Followup r89515, fix double spacing in API Error message
Add both customcssprotected and customjsprotected to the possible errors output for editpage
2011-06-05 18:34:26 +00:00
Antoine Musso
6a8e32e986 Single messages can be passed as strings to Api::dieUsageMsg()
Since r88045
2011-05-19 17:51:16 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Alexandre Emsenhuber
4d6fa1e22f Article::updateArticle() doesn't exist anymore 2011-05-13 08:43:42 +00:00
Sam Reed
fa64025161 More parameter documentation 2011-02-19 00:30:18 +00:00
Alexandre Emsenhuber
1fb56df473 Added "context title" to replace $wgTitle, current behavior unchanges, but added a comment that this might change in the future to completely remove $wgTitle usage in EditPage
Also removed null check on showEditForm() since $wgTitle is set on ApiEditPage.php, so it won't catch anything
2011-02-10 17:08:37 +00:00
Sam Reed
1f05665cf3 Styleli[zs]e the API up to date (Been a while since) 2010-12-30 17:06:09 +00:00
Sam Reed
6309c920dd Delete all the "API for MediaWiki 1.8+" comments
Add since to ApiQueryQueryPage
2010-12-22 20:52:06 +00:00
Bryan Tong Minh
b98f2a5a71 (bug 25174) Add equal sign to boolean parameters in examples, so that the examples work immediately when posted 2010-11-23 22:05:27 +00:00
OverlordQ
f2df835d56 Revert r69337 (Removal of minordefault preference) 2010-11-01 18:58:24 +00:00
Roan Kattouw
d1c9916e9c Revert r70703 and followup r70715: broke &redirect for API edit with a fatal error 2010-10-23 17:48:08 +00:00
Sam Reed
42b5c265c0 * (bug 25248) API: paraminfo errors with certain modules
Added a needsToken() function, rather than calling getTokenSalt, which can throw silly errors due to dependencies on parameters
2010-10-01 20:12:50 +00:00
Platonides
50e2405a03 Refactor to avoid defining globals inside switches. 2010-08-12 14:25:07 +00:00
Tim Starling
cc9f81ed94 * Revert r66878, completely misses the point of factoring out doEdit() in the first place, which was to separate the UI layer from the backend layer, to support callers with alternate UIs or no UIs.
* Reverted followup 66880.
* Reverted dependent changes r67752, r68606, r68608, r68609. The point of deprecating insertArticle()/updateArticle() was to allow the UI code to be moved to EditPage. If you move that exact EditPage-specific functionality back into Article::doEdit(), and call it from all sorts of non-EditPage places, then we'll hit the same sorts of bugs we had before r14834.
2010-08-09 08:33:42 +00:00
Jack Phoenix
366a66ecf9 follow-up to r70703: converted spaces to tabs and trimmed trailing spaces 2010-08-08 16:45:14 +00:00
X!
04e6adbbd9 Followup to r70658: Code styling, use ApiPageSet to fix redirects. 2010-08-08 15:03:30 +00:00
X!
9f025aeb1d (bug 24330) Add &redirect parameter to ?action=edit 2010-08-08 01:14:48 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
Roan Kattouw
b37d412ea1 (bug 24665) When starttimestamp is not specified, fake it by setting it to NOW, not to the timestamp of the last edit. This caused 'pagedeleted' errors for pages that were deleted then partially undeleted that could only be gotten rid of by setting starttimestamp, while the docs claim not setting starttimestamp causes all such errors to be silenced 2010-08-06 12:15:23 +00:00
Sam Reed
f77fff0ffb Followup r70461 if PARAM_REQUIRED is set, use for missing param in getPossibleErrors in ApiBase
All but ApiQueryBacklinks
2010-08-04 19:20:15 +00:00
X!
1afd723c5b Followup to r70460 and r70461: Use true instead of 1 2010-08-04 14:29:39 +00:00
X!
8b466d3d0d Followup to r70460: Committed wrong version of ApiBase.php, convert all core API modules to PARAM_REQUIRED syntax 2010-08-04 14:15:33 +00:00
Sam Reed
5387b8a806 Stylize API up to date
Fix spaces from r69755

Minor update to RELEASE-NOTES per r69753
2010-07-23 07:33:40 +00:00
Aryeh Gregor
1b1d821d16 Remove 'minordefault' preference completely
See bug 24313.  The preference encourages people to mark changes minor
by mistake, but it's better to have minor changes not marked minor than
non-minor changes marked minor.  enwiki users at [[Help talk:Minor
edit]] seemed to think it was a good idea.  Plus, I'm always in favor of
removing user preferences where possible.

The only likely fallout of note is some bot operators who didn't notice
this suddenly find their bot not marking anything minor.  I doubt it
will cause major problems, though.
2010-07-14 18:50:32 +00:00
Sam Reed
f5c639fd10 Stylize API
Add a few braces
2010-07-06 13:15:59 +00:00
Sam Reed
41f8208fb1 Minor followup to r68636, add to getPossibleErrors 2010-06-27 20:30:43 +00:00
Sam Reed
3fe7b6912b * (bug 24136) unknownerror when adding new section without summary, but forceditsummary
Handle AS_SUMMARY_NEEDED in ApiEditPage

Fixup some braces
2010-06-27 19:22:46 +00:00
Derk-Jan Hartman
921619b119 Correct the address of the FSF in some of the GPL headers
59 Temple Place -> 51 Franklin Street
2010-06-21 13:13:32 +00:00
Bryan Tong Minh
26fa8cb9f1 Return some more verbose error messages when editing fails using the API. Added wfDeprecated to Article::updateArticle() and used the Status result from Article::doEdit directly in EditPage::internalAttemptSave. 2010-06-09 19:52:11 +00:00