Commit graph

2385 commits

Author SHA1 Message Date
umherirrender
4bf413c990 (bug 32381) Allow descending order for list=backlinks, list=embeddedin
and list=imageusage

Also avoid some filesorts when using redirect param of that modules
due to fields in order by, which are constant in where

Change-Id: I4b1c4282ab3be9cb93601c57d660520456cf8617
2012-07-04 22:48:08 +01:00
umherirrender
f191e6320f (bug 32382) Allow descending order for list=iwbacklinks
Change-Id: If9425f3d6dbee3da34e875c1b02088478c3d6d53
2012-07-04 22:45:04 +01:00
umherirrender
a2e40f12f5 (bug 31777) Upload unknown error ``fileexists-forbidden''
adding messages to ApiBase::$messageMap and to message files for client
side localisation

Change-Id: I37e03130c6b90e4614514cd76b73eab6890eb82f
2012-07-01 19:35:31 +02:00
Siebrand
5fb8b96195 Merge "Expose the log_id of the deletion log entry in the action=delete API" 2012-07-01 15:55:29 +00:00
Siebrand
d842a5582f Merge "(bug 32348) Allow descending order for list=alllinks" 2012-07-01 15:03:20 +00:00
Siebrand
0e48e20587 Merge "Bug 36453 - Provide the git info on action=query&meta=siteinfo" 2012-07-01 14:22:59 +00:00
Alexandre Emsenhuber
58852d8827 Deprecated Title::userIsWatching(); use User::isWatched() instead.
* The problem is that Title::userIsWatching() relies on $wgUser,
  which is not suitable on every case. Instead User::isWatched()
  requires both an User and a Title object.
* Replaced all core calls from the former to the latter
* Added a cache in User for the WatchedItem instances so we do not
  need to do a database request every time something want to know
  whether a page is watched or not, which can happen several times
  per request.

Change-Id: Ifa9c55b7ffb487ce6893c74df233eedc7654dc5e
2012-06-29 23:22:35 +02:00
Max Semenik
dd6519709b Bug 36453 - Provide the git info on action=query&meta=siteinfo
Change-Id: I3d6c79d0d2cafd533f39e255940869087778d884
2012-06-30 00:04:42 +04:00
umherirrender
a9a71011ff Change some NS_IMAGE to NS_FILE
Change-Id: Id530c88d24df1a47a2f6565911184008b67fe04d
2012-06-24 21:50:10 +02:00
umherirrender
f1f1c2e794 Use canonical parser option for linkupdate in api purge
This patch makes sure, that the links table updated against the
content language. This also enabled the limit report, which than
is also stored in the parser cache along with the html.

Change-Id: I2a0b09d7250813809f1b2a8cba3e4f53a6686002
2012-06-23 00:25:33 +02:00
Catrope
81c1225bb8 Merge "API: Reset token cache on login, so API tests work" 2012-06-22 21:39:47 +00:00
daniel
bfa1ced1a7 API: Reset token cache on login, so API tests work
Previously, logging in several times during a phpunit run would change the
session token, but keep the edit token, leasing to "bad token" failures for
all but the first login.

Change-Id: Iad49c990c5661d55cd907b8441addb74eb0ef694
2012-06-22 23:34:59 +02:00
daniel
7d3d38748a Fix session handling in API test cases.
* Use the API module's own context to check edit tokens.
* Use the global session if none is provided to doApiRequest.
* Fix ApiFlockTest to not pass an empty session, so the tokens from
  the global request can be used.

Change-Id: I2bff2390f43beb984b1b451bcf4e41271b2f054f
2012-06-21 22:29:19 +02:00
Aaron Schulz
6befd65ccf Merge "(bug 37301) add sizediff to list=usercontribs" 2012-06-19 21:31:19 +00:00
umherirrender
b84ffc114a (bug 32348) Allow descending order for list=alllinks
Change-Id: Ia87f743d2a28594d32fe092bc839051ac7a37729
2012-06-17 09:33:23 +02: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
Catrope
3068742546 Expose the log_id of the deletion log entry in the action=delete API
This entails some refactoring to actually surface the log_id all the way
up:

* Made doDeleteArticleReal() return a Status object rather than a
  constant, and put the log_id in $status->value. This Status object is
  also passed to the ArticleDelete hook.
* Kept doDeleteArticle() the same for extension compatibility.
* Switched all core callers of doDeleteArticle() to
  doDeleteArticleReal() and surfaced the error message from the Status
  if appropriate, rather than hardcoding 'cannotdelete' all over the
  place.
* Exposed the log_id in ApiDelete
* Add 'delete-hook-aborted' message for when a hook aborts the deletion
  but does not provide an error message. Previously this just caused the
  'cannotdelete' message to appear.

Change-Id: Ia6415b390d5d4172ce96667f46ccdba2be02461f
2012-05-13 18:20:05 -07: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