Commit graph

2370 commits

Author SHA1 Message Date
Aaron Schulz
6befd65ccf Merge "(bug 37301) add sizediff to list=usercontribs" 2012-06-19 21:31:19 +00:00
umherirrender
fb9bd9c006 (bug 37301) add sizediff to list=usercontribs
Moving function getParentLength from SpecialContributions to Revision
and use it in the list module. The size of the parent is selected by a
batch, like the special page.

Change-Id: I6e388e75cd765f2a918b0c192477d87347e96bcd
2012-06-16 09:47:11 +02:00
Platonides
7d3db079f6 Use canonical class name ApiBase also in ApiQueryLangLinks
Change-Id: I11c7b0540078e6934c8d9d8fa21891a87bfebd21
2012-06-15 22:46:56 +02:00
Platonides
3797340195 Use canonical class name for ApiBase
s/Apibase::PROP_NULLABLE/ApiBase::PROP_NULLABLE/

Change-Id: I222df124f947face5970bab810f497c43000dbf2
2012-06-15 22:41:01 +02:00
Aaron Schulz
a3a293f0e6 Merge "avoid Title::exist/getArticleId in ApiQueryInfo::extractPageInfo" 2012-06-14 19:56:02 +00:00
Catrope
2e352de1de Merge "Added result properties to action=paraminfo" 2012-06-12 20:52:35 +00:00
umherirrender
43b1c36ab3 avoid Title::exist/getArticleId in ApiQueryInfo::extractPageInfo
For missing title the pageid is not set inside the Title objects, but
the pageid is given to that method, so it is better to use that
pageid to check for exist or to use the pageid, instead of using the
Title method.

Change-Id: I07db242eb37731610ac7a83acdb5e6adfc2951aa
2012-06-08 11:02:46 +02:00
Petr Onderka
80aa025528 Added result properties to action=paraminfo
Added information about the properties of the results of API calls
to action=paraminfo, including information about "property groups":
what should the prop parameter be set to to get that property.

Uses the same format for types as parameters already do.
The output format of some modules doesn't fit this, so the result
properties for them weren't added, or only partially.

Partially implemented modules:
* expandtemplates:
  parsetree is in its own tag
* protect, allusers, backlinks, deletedrevs, info, imageinfo,
  logevents, querypage, recentchanges, revisions, searchinfo,
  usercontribs, userinfo, users, watchlist, upload:
  response with partially complex structure

Not implemented modules:
* feedcontributions, feedwatchlist, opensearch, rds:
  non-standard reponse
* help:
  error is normal response; not very useful for automated tools anyway
* paraminfo, parse, pageprops, siteinfo, userrights:
  response with complex structure

Change-Id: Iff2a9bef79f994e73eef3062b4dd5461bff968ab
2012-06-06 19:24:59 +02:00
umherirrender
f263c6bcf2 Use Title::newFromRow in ApiPageSet::processDbRow
This avoids a query per title (due to Title::exist) in ApiQueryInfo.
The 3 minimum fields are always selected in ApiPageSet

Change-Id: Ic4876f947357d84a2f37bec60db3ccd44fe236ac
2012-06-06 18:39:30 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Brad Jorsch
c42131dd8e (bug 32643) Prevent action=purge&forcelinkupdate crash
action=purge with forcelinkupdate crashes when the rate limit is
reached, because the module passes an array rather than a string to
setWarning. The appropriate string is in the 'info' key of the array, so
just use that.

Change-Id: Ia0215290197e115e7272f945ab1bc5b81aeec80a
2012-06-02 15:41:06 +02:00
Hoo man
932774a5e2 Fixed the API doc. for aurights (list=allusers)
Listings with aurights can't show users with rights which are
granted by implicit or auto-promoted groups like *, user, or autoconfirmed.
This is my first commit, btw.

Change-Id: I083eb977393729961317d0f3cf9f7cfaa50fde51
2012-05-29 14:17:19 +02:00
Aaron Schulz
7d1004bd5c Merge "user table: replace some '*' with explicit fields in selects" 2012-05-25 17:14:08 +00:00
Catrope
97f2db74a0 Merge "Add some more detailed info about the xslt param of format=xml" 2012-05-25 16:01:28 +00:00
Liangent
69ebd8d7ce Add some more detailed info about the xslt param of format=xml
Change-Id: I77e1dcbdf3ff1d201a2346c5a397469b4fc21d74
2012-05-25 08:56:02 -07:00
umherirrender
2f190c4792 user table: replace some '*' with explicit fields in selects
It is good practice to select only fields, which are used later

Change-Id: Iaaa252d594112894334a8ee9916007352d5bc4e7
2012-05-25 17:53:29 +02:00
Aaron Schulz
d2604f086f Merge "Revert "(bug 30625) Add, to every API upload response, the warnings raised."" 2012-05-23 19:32:51 +00:00
Brion VIBBER
bca71b173e Revert "(bug 30625) Add, to every API upload response, the warnings raised."
Inconsistent formatting (returns an empty array vs a full object, breaks UploadWizard)

This reverts commit e2b3d53db5
2012-05-23 19:27:48 +00:00
Aaron Schulz
e066ee0c47 Merge "(bug 30625) Add, to every API upload response, the warnings raised." 2012-05-22 21:26:33 +00:00
Mark Holmquist
e2b3d53db5 (bug 30625) Add, to every API upload response, the warnings raised.
The current API implementation has a parameter for uploads that is
called "ignorewarnings". Currently, it will not only suppress any
warnings from stopping the upload, it will also lose any data from
those warnings.

This patch is sort of on the way to solving Bug 30625, which is in
the UploadWizard extension. That extension needs to know when a file
upload *will* fail, barring a change in some data, in order to make
it easier for a user to fix the foreseeable problems. The solution is
either to fix it this way, or to somehow spoof a file upload, and see
if it succeeds. In the hopes that other extensions will also find
this useful, I opted for the former.

Change-Id: I08b4e29e89ade6cf391ae044fceb788aaba3f5b4
2012-05-22 14:23:23 -07:00
Aaron Schulz
fdb74872a8 Merge "multi dbms support in api" 2012-05-20 18:15:42 +00:00
Aaron Schulz
f1c86117a1 Merge "Fill GenderCache inside ApiPageSet" 2012-05-20 18:13:59 +00:00
Aaron Schulz
5ec99f4b24 Merge "Make errors from ArticleSave hooks propagate to the interface" 2012-05-18 05:39:19 +00:00
Aaron Schulz
edf417c8e1 Merge "prop=revisions: join user table to get user name" 2012-05-16 22:20:49 +00:00
Aaron Schulz
6e96a6e8e6 Merge "Add DebugInfos to api result" 2012-05-16 22:17:17 +00:00
umherirrender
278bb4414f multi dbms support in api
Add some calls to Database::timestamp
Change some calls from Database::strencode to
Database::addQuotes to avoid ' in raw sql
Remove ' from ints in raw sql
Rename some vars to avoid duplicate names

Change-Id: I63f5602fa968f969a42932902a3ccc45fc54b432
2012-05-16 19:22:36 +02:00
umherirrender
0ea2c38727 Fill GenderCache inside ApiPageSet
the queries for title and pageids are own queries created by the api,
which does not use the GenderCache, that can produce a query per row

Change-Id: I932f8d9d1cfa751dbb6f5237e2de325527d3ff53
2012-05-16 16:46:22 +02:00
umherirrender
a5e50e8b2f prop=revisions: join user table to get user name
this avoid a lazy load of the user name for each row

Change-Id: I5d8983476e03cc2f6dad074577402f5255080838
2012-05-16 16:38:40 +02:00
Aaron Schulz
060ba3cb68 Merge "Generalizing LinksUpdate to allow extensions to add arbitrary update handlers." 2012-05-14 22:20:04 +00:00
daniel
a12ce17c6e Generalizing LinksUpdate to allow extensions to add arbitrary update handlers.
This supercedes I6d03bf2a, using better names for the new classes and
incorporating the changes requested by Aaron.

This change introduces the base class SecondaryDataUpdate to be used for any
updates that need to be applied when a page is changed or deleted. Until now,
this was done by the LinksUpdate class for updates and WikiPage::doDeletionUpdates
upon deletion. This patch uses a list of SecondaryDataUpdates in both cases.

This allows extensions (e.g. via the ContentHandler facility, once that is in) to
easily specify what needs to be done when a page is updated or deleted in order to
keep any secondary data stores (such as link tables) in sync.

Note that limited transactional logic is also introduced, so SecondaryDataUpdate
can be implemented to only commit their changes if all updates were performed
sucessfully.

Patch Set 2: fixing some coding style issues mentioned by Nikerabbit.

Patch Set 4: some stuff I kept from the old LinksUpdate class needs cleanup,
             but might break extensions when changed. Marking as todo for now.

Patch Set 5: fixed misnamed member in LinksDeletionUpdate (thanks Aaron).

Change-Id: Ibe3e88fadd8c1d4063cf13bb6972f2a23569a73f
2012-05-13 20:53:37 +02:00
umherirrender
0a5e1bf76a Add DebugInfos to api result
This allow to get the queries of the api due the same api request,
when setting $wgDebugToolbar = true, that acts like the inline script
added to index.php

Change-Id: I7c121822827137ba098d95a54ec90f824e0ddf01
2012-05-13 11:20:04 +02:00
Aaron Schulz
aefa39ead9 Merge "Add maxresults to list=querypage" 2012-05-12 17:13:35 +00:00
Aaron Schulz
53d7092ab4 Merge "ApiPageSet::populateFromTitles can work with Titles" 2012-05-12 17:13:03 +00:00
umherirrender
94395dcdd3 Add maxresults to list=querypage
Change-Id: I96e12428305d86c623e810d58f3f3173906f42e1
2012-05-12 17:11:47 +02:00
umherirrender
e552ca3dca ApiPageSet::populateFromTitles can work with Titles
Change-Id: I492c350cbb487c1a35bc96c7bcf5f0af9a9d530c
2012-05-12 17:02:53 +02:00
umherirrender
223abdc2ca set tidy = true for action=purge&forcelinkupdate=
Change-Id: Ibf17c312193629b64c3d5184b8fb26387862dd0d
2012-05-12 15:56:31 +02:00
umherirrender
e9fa97f76e Add unit test for MWNamespace::isNonincludable
rename MWNamespace::isNonincludableNamespace
to MWNamespace::isNonincludable, because "Namespace" is already in the
class name

Change-Id: Ie982835c7dc84cb10c823996e5360cc1b342f704
2012-05-11 19:52:34 +02:00
Catrope
b1e0daa428 Make errors from ArticleSave hooks propagate to the interface
Aborting a save from the ArticleSave hook and putting an error in
$status didn't actually propagate the error message to the user, but
instead displayed the edit conflict page (!). Fix this so that if we get
an unrecognized error from ArticleSave, we treat it as an extension
error and render it rather than going into conflict mode.

Similarly, make the API attempt to render the error through
dieUsageMsg() like it already does for AS_END

Change-Id: Iccf78480240d0c7ed321438c8190472805957099
2012-05-10 12:10:25 -07:00
Reedy
c87a63935a Merge "(bug 19195) Make user IDs more readily available with the API" 2012-05-10 18:47:42 +00:00
Petr Onderka
7264a75515 Fixed typo in description in categorymembers module
Change-Id: I7d82df6a4b0f65fe763e0eea23dfa05ae2e7c5f1
2012-05-10 20:36:34 +02:00
Brion VIBBER
bf76d27595 Merge "(bug 35993) gettoken should go die in a fire (part 1)" 2012-05-08 20:26:28 +00:00
Aaron Schulz
9b98d3f637 Merge "Don't make two database requests to load the same object, again." 2012-05-08 18:50:15 +00:00
Brion VIBBER
0949454a57 Merge "Make getContinueStr protected as it's used in subclass by TMH" 2012-05-08 18:28:30 +00:00
Brion VIBBER
3807ba51b9 Merge "ORDER BY/GROUP BY accept arrays" 2012-05-08 18:10:38 +00:00
Reedy
2173e1fbee Make getContinueStr protected as it's used in subclass by TMH
Change-Id: I3bd265805122d3ae12b986d1396ca634ca9f8097
2012-05-08 19:08:43 +01:00
Tim Starling
f8e0327656 Fix for r113993: don't log UsageException instances
Change-Id: I205252534fcf7a0ee486938123c1e15cd036f4f1
2012-05-08 11:05:09 +10:00
Szymon Świerkosz
aa86d2d3e6 (bug 35993) gettoken should go die in a fire (part 1)
Mark gettoken param as deprecated, so users can fix their tools.
The second part will remove the support for gettoken from ApiMain,
but that is in the future.

Change-Id: I369ddc740c38d80aa8389544087ac6671cabc618
2012-05-06 16:43:09 +02:00
Szymon Świerkosz
7cf5f38232 Move optionstoken from meta=userinfo to action=tokens.
Follow up to I0d6c654a7354ba77e65e338423952a6a78c1150f.
I have also added a URL to a help page on mw.org.

Change-Id: Ie223930cfc313aff150e2dcfd70b74bf4360a8a8
2012-05-06 16:07:17 +02:00
umherirrender
ffa3486aa8 (bug 33224) add variants of content language to meta=siteinfo
Change-Id: I0b92e1e626f0c5bc543c5d134eb44d7ca7722217
2012-05-06 05:13:55 +02:00