Commit graph

2192 commits

Author SHA1 Message Date
Max Semenik
6bd85a6a2c Follow-up r97303: sort module names in paraminfo's paraminfo 2011-12-20 07:50:45 +00:00
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
Aaron Schulz
3a0a647efb FU r106514: use base 16 SHA-1 to be consistent with image info 2011-12-18 16:35:45 +00:00
Alexandre Emsenhuber
46c5d3edad * Merged WikiPage::updateRestrictions() and Title::updateTitleProtection() into WikiPage::doUpdateRestrictions(); older methods still work for backward compatibility, but marked Title::updateTitleProtection() as deprecated and for removal in 1.20 since no extension calls it
* Removed permissions check from WikiPage::doUpdateRestrictions() and left it for callers, resolves the todo from documentation
* Inverted $expiry and $reason parameter between WikiPage::doUpdateRestrictions() and WikiPage::updateRestrictions() for more consistency; WikiPage::doUpdateRestrictions() also requires all parameters to be passed
* WikiPage::doUpdateRestrictions() returns a Status object instead of bool for the older one; only possible error at the moment is a read-only database
* Updated core calls to these functions
* Made maintenance scripts using it simply protect all actions returned by Title::getRestrictionTypes() instead of hardcoded 'edit' and 'move'
* This also means that protect.php can be used to protect a non-existing page for creation
2011-12-18 16:01:31 +00:00
Alexandre Emsenhuber
0eff3f59ad Pass the User object to Revision::userCan() 2011-12-18 14:07:01 +00:00
Aaron Schulz
02e3ce636a Kill some useless code in r106514 2011-12-17 23:14:39 +00:00
Sam Reed
997fb135cd Per bug 28901, and Duplicatebug on r105831, only list the Article ID if it has already been loaded
Not a long term fix, but saves potentially a lot of database queries to lookup article ids, until the other issues on bug 28901 are tidied up
2011-12-17 19:55:49 +00:00
Sam Reed
b0818acd86 More example conversions/additions
Ping r106439
2011-12-17 19:10:33 +00:00
Aaron Schulz
21ee783cbe Expose rev_sha1/ar_sha1 to API (bug 21860) 2011-12-17 18:27:38 +00:00
Sam Reed
1b46e91efd Convert a few more descriptions
Ping r106439
2011-12-16 15:45:16 +00:00
Sam Reed
6c80c5ff87 Prep work for * (bug 33147) API examples should explain what they do
Now formatted in the autogenerated documentation

Format for paraminfo adds a description attribute to output


query allimages descriptions are tranformed, need to do/add to other ones
2011-12-16 15:28:35 +00:00
Sam Reed
fb64176e7c Use a revision return method for revisions, follows up r105828 2011-12-15 17:21:56 +00:00
Robin Pepermans
be2de16942 update all core usage of deprecated Title::userCanRead() 2011-12-13 11:05:30 +00:00
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Jeroen De Dauw
4544a78316 rem use of escapeLocalURL 2011-12-13 04:58:48 +00:00
Max Semenik
da663eaf97 Caps fix in API parameter description 2011-12-12 17:22:20 +00:00
Sam Reed
76762a26b9 Make ApiQueryBase::addTitleInfo() add the pageid also 2011-12-11 21:07:39 +00:00
Sam Reed
35e229c627 More documentation updates as I've been going around 2011-12-11 20:57:57 +00:00
Sam Reed
d1e77338a6 * (bug 32495) API should allow purge by pageids.
ApiPageSet isn't really designed for non query usage, but a little hacking and it can be made to work in the ApiPageSet mould. Allows us to use titles, pageids and revids, without the work of validating them and such ourselves

Same caveat that you can't use a mix of them in one request - tough!
2011-12-11 20:43:42 +00:00
Sam Reed
7ea2f68c3a Followup r105823, make it protected 2011-12-11 20:41:23 +00:00
Sam Reed
b8d83ec568 Adding a getDB function to ApiBase...
Not all subclasses will need/want it. It does however make it easier to pretend non ApiQuery derivatives actually are...
2011-12-11 20:32:37 +00:00
Sam Reed
9457d80c3f * (bug 32415) Empty page get no size attribute in API output 2011-12-11 18:39:31 +00:00
Alexandre Emsenhuber
55ec0e84aa Use ParserOptions::newFromContext() instead of 'new ParserOptions' to use the local context and not $wgUser or $wgLang 2011-12-11 10:16:32 +00:00
Antoine Musso
679e1330b4 revert r104468 per CR: not needed :-) 2011-12-06 12:49:59 +00:00
Jan Gerber
0095c08ed2 Use database to track uploaded chunks and concatenate at the end.
with i18n documentation dont break phpunit

follow up r93720
2011-11-30 14:56:40 +00:00
Roan Kattouw
e83bb90997 Revert r104659 and its followup r104665: break the unit tests with a fatal error. This cripples our CI system, we can't detect new failures this way. 2011-11-30 13:54:35 +00:00
Jan Gerber
d70c169b90 Use database to track uploaded chunks and concatenate at the end.
follow up r93720
2011-11-30 08:55:16 +00:00
Robin Pepermans
7bf35ceb8d The URL wasn't loading when the database is used (interwiki cache works). "PHP Notice: Trying to get property of non-object in /www/w/includes/api/ApiQuerySiteinfo.php on line 295"
This reverts r97806. It took me some time to find out, but r96475 accidentally backported the change from $row->iw_url to $row['iw_url'] (etc) to 1.18, which was fixed in r97789. That revision was merged to trunk, which shouldn't have been done either. I.e. until 1.18 it is an object, from 1.19 it is an array.
2011-11-29 16:48:37 +00:00
Sam Reed
2fc7279345 * (bug 32688) Paraminfo for parameter "generator" of the query module shows too many types
Pass prop and list through the generator filtering in the constructor
2011-11-28 20:35:32 +00:00
Sam Reed
124f6229ac Followup r104445, swap the xmlnamespace url back to http:// 2011-11-28 20:04:40 +00:00
Sam Reed
7f3f1f7caf Followup r104441
Fix capitalisation mismatch
2011-11-28 19:17:06 +00:00
Sam Reed
302e55c18e URL-ify index.php urls 2011-11-28 19:02:59 +00:00
Sam Reed
53000baecf Oh noes, moar http:// -> https:// 2011-11-28 15:43:11 +00:00
Sam Reed
f3839fe71f Added "ApiGetDescription" hook 2011-11-28 15:33:28 +00:00
Sam Reed
af5d190302 Https for all!
(omg, this hadn't been reported)
2011-11-28 15:17:46 +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
Roan Kattouw
78d5512e7b Followup r102951: per CR, remove duplicated empty string from API extlinks modules' protocol params, and remove // from the list of protocols on Special:LinkSearch 2011-11-23 13:41:39 +00:00
Roan Kattouw
792c38f424 (bug 26854) Invalid user names go unchecked. Applied most of the patch submitted by Søren Løvborg, checking for null return values from User::newFromName() 2011-11-20 10:55:58 +00:00
Alexandre Emsenhuber
7e4248060b Use ParserOptions::newFromContext() instead of 'new ParserOptions' to use the local context instead of relying on $wgUser and $wgLang 2011-11-19 08:54:03 +00:00
Alexandre Emsenhuber
2c4d6b6992 Follow-up r103332: fix "invalidoldimage" error message to say "oldimage" instead of "oldid" 2011-11-19 08:29:49 +00:00
Alexandre Emsenhuber
b1bb28c606 * Use ParserOptions::newFromContext() to not depend on $wgUser and $wgLang
* Use a WikiPage object instead of Article to get the text or the ParserOutput and create the object directly in getParsedSectionOrText()
* Use Title::getLatestRevID() instead of Article::getRevIdFetched() since the latter will always return the current revision ID when 0 is passed as second parameter to the constructor
* Pass the User object to Revision::getText()
* Removed double setting of $wgTitle
2011-11-18 21:36:57 +00:00
Sam Reed
fcb28f12ea Fix the rest of 'inlanguage ' in r93765 2011-11-17 19:06:30 +00:00
Sam Reed
9157749df6 Fix trailing space in r93765 2011-11-17 19:00:09 +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
Alexandre Emsenhuber
2bb8c2ea4d * Use WikiPage instead of Article
* Create the WikiPage object directly in execute() and pass it to both delete() and deleteFile()
* Reordered parameters of delete() and deleteFile() to be consistent and take both on the WikiPage and User objects (instead of relying on $wgUser); no callers outside of this class
* Fixed deleteFile() to match the behaviour of FileDeleteForm with oldimage parameter
* Pass the User object to getPermissionsError()
* Factorised duplicated code
* Added missing error code to ApiBase (and also a new one)
* Added missing possible error codes (with a new one too)
2011-11-16 15:57:56 +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
Roan Kattouw
2ff455acb7 Remove commented-out variable ApiMain::$mRequest 2011-11-14 19:44:13 +00:00
Roan Kattouw
71461de9de Followup r99224: add message to ApiBase::$messageMap too 2011-11-14 14:40:55 +00:00