Commit graph

3163 commits

Author SHA1 Message Date
umherirrender
f0d2926c03 Remove ApiBase::createContext() (deprecated since 1.19)
Change-Id: Iee20e1c5e5b83b5b43303bde7e524b95b74eb62b
2014-06-25 20:35:56 +02:00
Brad Jorsch
839f02bb45 Actually fetch config object in ApiQueryRecentChanges::getResultProperties
Change-Id: Id9c316733896a27ce3f6c3e0e5efdf62f7d1ff1b
2014-06-24 12:54:10 -04:00
Kevin Israel
1402236c4b Remove use of OutputPage::addParserOutputNoText()
Simply clicking "Show preview" on the edit page triggered a deprecation
warning.

Also removed the wfDeprecated() call from the method, which is still used
in a few WMF-deployed extensions without a corresponding open change.

Follows-up e8f1fede77.

Change-Id: I2cfdc84b92cf13478b9f462028d525e4ec14fdf2
2014-06-24 04:53:44 -04:00
jenkins-bot
502cbf6eac Merge "ApiParse: Add disableeditsection parameter" 2014-06-23 13:57:23 +00:00
This, that and the other
848c335371 Expose $wgLocalInterwikis via the API
This will hopefully be useful to Parsoid.

Bug: 66709
Change-Id: I67d789172d4c6b786ed781f80e513692b3ae4119
2014-06-22 15:26:28 +10:00
Bartosz Dziewoński
326f3f450c Add a 'namemsg' parameter to $wgExtensionCredits for localizable names
Works similarly to 'description' and 'descriptionmsg', but 'name'
is still required because of weird shenanigans Special:Version does.
(And would be a good idea anyway for backwards-compatibility with
older MediaWikis.)

The primary use-case is skins (which have already traditionally had
translateable names in MediaWiki, but weren't always shown on
Special:Version), but there's no reason why regular extensions can't
use this too.

Skins which already have a translated name for Special:Preferences
('skinname-<skin>' messages) can reuse the same message here.

Change-Id: Iae6f770a8fe1968670429c22aefc1ae55e8dba6f
2014-06-21 13:13:44 +02:00
Kunal Mehta
933df271be ApiParse: Add disableeditsection parameter
To disable edit section links in the parser output

Bug: 62723
Change-Id: I499c4bb0cd85964e78db3362e13a8033a2e9aed0
2014-06-20 23:09:18 -07:00
jenkins-bot
2da03f8806 Merge "Allow interlanguage link prefixes that are not language codes" 2014-06-20 15:19:32 +00:00
This, that and the other
7665f7d767 Allow interlanguage link prefixes that are not language codes
$wgExtraInterlanguageLinkPrefixes holds a list of interwiki prefixes to be
treated as language codes if $wgInterwikiMagic is true.

To set the display text for the interlanguage links generated by this
code, you need to create MediaWiki:Interlanguage-link-foo, where "foo" is
the interwiki prefix.  To provide a friendly site name for the link title
text, use MediaWiki:Interlanguage-link-sitename-foo.  On the WMF cluster,
these messages could be set using the WikimediaMessages extension.

Information about extra language links (in the site language only) is
provided via the API in meta=siteinfo&prop=interwikimap.

Bug: 32189
Change-Id: I3d04760e2d9fb3320bb71e3d5ad115eed54a899c
2014-06-20 11:29:05 +10:00
Brad Jorsch
682c7da095 ApiExpandTemplates: Start parse before creating frame
The code added in Id12cbe4a is creating a frame from the parser object
before actually starting a parse, meaning the frame ends up with no
title, which causes problems for other stuff that assumes the frame
*does* have a title.

While we could possibly change from calling ->preprocess() to
->recursivePreprocess() to avoid re-starting the parse, there are some
hooks called from ->preprocess() that it's probably best to continue
calling to not break BC.

Bug: 66798
Change-Id: If2ca8ab94ab81ee10f33ce1f4ee75655b7c1e680
2014-06-18 14:20:46 -04:00
C. Scott Ananian
3f9d79ebe0 The siteinfo API uses '' as an attribute value, not true.
Bug: 66723
Change-Id: Ibef772a72bac6b700ba2a3725832f50b057bf503
2014-06-17 10:54:15 -04:00
jenkins-bot
af2c2b6331 Merge "Capitalise Message in SpecialAllMessages files" 2014-06-17 08:54:46 +00:00
Roan Kattouw
de7d383d8f Followup e48ecbc5: fix fatal error due to undefined variable
Bug: 66669
Change-Id: I195a5ff539f09addb92d2bb07d53bdb3aef0db1f
2014-06-16 18:40:35 +00:00
Reedy
2dc420dd2a Capitalise Message in SpecialAllMessages files
No internal changes to Special:Allmessage etc made

Change-Id: I21a164af0b6ec123bf654cd1e4e7085b1192f067
2014-06-16 18:25:53 +01:00
Kunal Mehta
e179b4f11b API: Allow 'infinity' as a valid protection expiry
Change-Id: If9eb1f3e835579f5c8b8be22297a1eb26beda4e7
2014-06-15 23:46:37 +00:00
Reedy
e48ecbc524 Switch API to use Config classes
Only done where globals are config (so not $wgParser, $wgContLang etc)

Change-Id: Ic39cdd858cfb9096a2bc09618f97e64270d76f13
2014-06-15 23:56:38 +01:00
Brad Jorsch
68ce4da189 Use type hinting in ApiBase
For ideological reasons this was not included in Ie6bf1915.

Change-Id: I5f7119665746eb6fcf86c3a403caa2dcb67904eb
2014-06-12 16:54:41 +00:00
umherirrender
e6635401eb Change 'delete' to 'rollback' in action=rollback params description
Bug: 66406
Change-Id: Iab874f45b5baaa89a6345e351cc45ed16f5af6e8
2014-06-10 22:16:07 +02:00
Jackmcbarn
18d15fa138 Add PPFrame::getTTL() and setTTL()
Add functions to frames to control the TTL of their output, and expose
this via expandtemplates in the API.

Bug: 49803
Change-Id: I412febf3469503bf4839fb1ef4dca098a8c79457
2014-06-09 20:40:22 +00:00
Brad Jorsch
ad0ac845cc API: Add show=unread to ApiQueryWatchlist
This allows for retrieving only those pages that have changes since the
last visit.

Bug: 65246
Change-Id: I81d2fae39178708efc0f57e5acea93b50463bc7a
2014-06-09 14:14:04 -04:00
Brad Jorsch
26566732fa API: Add prop=unreadcount to ApiQueryUserInfo
People want to be able to fetch the count of unread pages on the
watchlist.

Bug: 65246
Change-Id: I890f21631ba074a7b3d660534c40e38773d8ea77
2014-06-09 12:22:05 -04:00
umherirrender
690d1f464b Add error 'pagecannotexist' to ApiBase::getTitleOrPageIdErrorMessage
Function can die with 'pagecannotexist' since
I2123e3a3034cb815cf35f66f2fbf2b94fb27069f

Change-Id: I10c496da147c1bf6ceb6d69b19170a0e62f1318c
2014-06-06 05:14:22 +00:00
umherirrender
eb708d8b28 Add missing possible errors to ApiQueryLogEvents.php
requireMaxOneParameter was added in
I53c4c6411e0b9e6383969afced0e4c193f1b64a1,
without update of the possible error list from that function call

Change-Id: I17f0ba8da4b21b2a5527bd4eff0d0e3308e24d9f
2014-06-05 17:46:31 +00:00
Jackmcbarn
e684a21782 Restructure output of ApiExpandTemplates
Create a new output format of ApiExpandTemplates and deprecate the old
one.

Change-Id: Id12cbe4aeaa39bea382cf3b78810589bb1c9368f
2014-06-03 16:25:08 -04:00
Jackmcbarn
e658bf0402 Add category output to ApiExpandTemplates
The preprocessor sometimes adds pages to categories itself, which don't
have any representation in the output of ApiExpandTemplates. Because of
this, add a new field containing these categories.

Change-Id: I7ae2eb9daf68e032dcc7a650bd8391d445ee1037
2014-05-30 14:31:53 -04:00
Brad Jorsch
d18ba4e9df Add PPFrame::isVolatile and PPFrame::setVolatile
Most wikitext is safe to parse once and then cache for when that same
wikitext is used again, such as for multiple transclusions of the same
template within a page. There are occasions, though, where some piece of
wikitext has side effects and so should not be cached; a prominent
example of such wikitext is the <ref> and <references> tags in Cite.php.

This change adds PPFrame::setVolatile so parser hooks such as <ref> and
<references> can indicate that they have done something that should not
be cached, and PPFrame::isVolatile so that callers of PPFrame::expand
can know when to avoid caching.

Bug: 46815
Bug: 31834
Change-Id: I95b3cf8781cf047cdb63da221cef45f3e7d1632e
2014-05-30 14:07:06 -04:00
Jackmcbarn
598dbc56de Allow filtering log entries by namespace (API)
Add parameter lenamespace to the API, allowing filtering of log entries by
namespace.

Change-Id: I53c4c6411e0b9e6383969afced0e4c193f1b64a1
2014-05-28 12:09:12 -04:00
jenkins-bot
422300936d Merge "Add missing possible errors to ApiRollback.php" 2014-05-28 00:25:02 +00:00
jenkins-bot
5821a0ef34 Merge "Fix broken @return documentation" 2014-05-25 07:45:03 +00:00
Thiemo Mättig
c10b4698f0 Fix broken @return documentation
I found one of these in Wikibase and run a global search.

Change-Id: I76c1519a47d7222f136272c59ea454b650808a86
2014-05-24 22:06:01 +02:00
jenkins-bot
0ff9863073 Merge "Store page_id in logging table for deletions and make queryable" 2014-05-23 23:15:55 +00:00
Adam Roses Wight
5971b2c39a API: Enforce section=new constraint when using 'redirect' mode
Finish implementation of the 'redirect' edit API parameter.  This flag
should only be used as a convenience when adding a new section, appending,
or prepending.  Any other usage must be done using the long-cut (fetch page,
determine if it is a redirect, follow redirects and edit the target page's
content).

This patch takes apart the "EditConflict_redirect" test, because it no
longer makes sense--unless you dear reader can figure out how to force an
edit conflict when only adding a section?

Bug: 24330
Change-Id: Ie3f7273c18e156da1e50e1a36aac2e5341710982
2014-05-22 16:08:22 -04:00
umherirrender
fb768db188 Expand doc of ApiBase::require*Parameter functions
Add a hint to the getError function which should be called in the
getPossibleErrors() function.
Also do this for getTitleOrPageId.

Change-Id: I601feb8a5b8699ce4d81814aa3cd127552a525ac
2014-05-20 19:35:57 +00:00
umherirrender
30c450552c Add missing possible errors to ApiRollback.php
requireOnlyOneParameter was added in
I346c6ae4fc0b48c5a794c3d621018baf9bde6b9e,
without update of  the possible error list from that function call

Change-Id: Iea51b9fc54d6854541509d44fad48a99db278fff
2014-05-20 21:21:13 +02:00
Matthew Flaschen
d5cc04641d Store page_id in logging table for deletions and make queryable
* Clone title so page_id is not 0 at log time.
* Change ApiQueryLogEvents to provide log_page as logpage (for all
  rows, not just deletions) if ids are requested.

Bug: 26122
Change-Id: I1c7f3a84f10df05d6b37dccbad4c8232edf51580
2014-05-19 23:02:44 -04:00
jenkins-bot
926f665234 Merge "API: Fix prop=revisions&rvdiffto= without rvprop=content" 2014-05-20 01:34:12 +00:00
C. Scott Ananian
87e0aa3441 Indicate whether interwiki links can use protocol-relative URLs.
Change-Id: I17360e44f0be7490357bc9bc7af27d0a950012de
2014-05-19 15:26:44 -07:00
jenkins-bot
e0dfd13037 Merge "Move ApiQueryRecentChanges::parseRCType to static method on RecentChange" 2014-05-19 18:57:25 +00:00
kishanio
b7cc86cdc0 Move ApiQueryRecentChanges::parseRCType to static method on RecentChange
Prior parseRCType was an private method in includes/api/ApiQueryRecentChanges and also
duplicated in includes/api/ApiQueryWatchList. This method has been made static and moved
to includes/changes/RecentChange.php.

Bug: 65071
Change-Id: Ic911fbcf9411c782685c4f956f8522051f2517f0
2014-05-17 15:07:01 +00:00
Thiemo Mättig
23632a4ecd Use precise ApiMain/ApiQuery type hints in all API modules
Which type is used depends on the ApiModuleManager responsible for
the API module. There are two managers, one in ApiMain and one in
ApiQuery. Both contain a list of API modules they instantiate.
Both use $this as the first parameter in the constructors of the
individual modules. There is no other regular way to instantiate the
modules, so we know the type must either be ApiMain or ApiQuery.

The lists don't intersect.

I would have prefered the naming scheme $mainModule for ApiMain
modules and $queryModule for ApiQuery modules but since this
doesn't add much I left the shorter variable names untouched.

Change-Id: Ie6bf19150f1c9b619655a06a8e051412665e54db
2014-05-16 11:07:23 -04:00
jenkins-bot
2b8254b2b5 Merge "Allow editing transcluded sections via the API" 2014-05-15 16:22:01 +00:00
jenkins-bot
e0639f56ba Merge "Update the API credits" 2014-05-13 19:42:08 +00:00
jenkins-bot
c5055c5302 Merge "API: Fix documentation for ApiBase::require*OneParameter" 2014-05-13 15:44:09 +00:00
Marius Hoch
aa1c3b8399 Require one of page id or page title as params to ApiRollback
Also made the code flow easier to understand by moving
calls to ApiBase::extractRequestParams up in the stack.

Change-Id: I346c6ae4fc0b48c5a794c3d621018baf9bde6b9e
Follows-up: I9c4e4fa
2014-05-13 17:37:07 +02:00
Brad Jorsch
b9fd30a4e4 API: Fix documentation for ApiBase::require*OneParameter
The existing doc blocks for all three of these functions is entirely
wrong.
* ApiBase::requireOnlyOneParameter
* ApiBase::requireMaxOneParameter
* ApiBase::requireAtLeastOneParameter

Change-Id: Id0dd86be3cbfa813a43f918c7d780c7ee2afc09e
2014-05-13 11:32:35 -04:00
Marius Hoch
e509c84e4e Update the API credits
Put Brad Jorsch (anomie) as lead developer (as he's the one
who does most of the review work etc. these days).

Made Yuri's lead developer time frame end in 2013 (as he
last commited to the api in 2013 AFAIS).

Change-Id: I640ddf251340214b4520d3072e22dfe6b54815fb
2014-05-13 17:17:05 +02:00
addshore
21de2cffb6 Allow use of ApiRollback using pageid instead of title
Change-Id: I9c4e4fa59af0b84416d950f1428da821318f85fc
2014-05-13 12:42:10 +01:00
MaxSem
a2f6b62aa9 Revert "Add API action=watch 'entirewatchlist' param to bulk-clear watchlist."
Unbounded modification = replication lag. And this function is specifically intended for clearing very large watchlists which would easily escalate to pageable lags of several minutes.

This reverts commit 66b07ea381.

Change-Id: Ie34be712884407e671d715e56bda3bff4a7e78f4
2014-05-12 20:18:50 -07:00
Siebrand Mazeland
4b8523198f Make phpcs-strict pass on includes/ (4/~10)
Change-Id: I2767205a7059adfb8fa090a82abd332e518f2590
2014-05-11 19:35:09 +00:00
robin
f930d0c5a2 Always link to diff in watchlist feed
Remove option to link to diffs in watchlist feed instead of the page itself, which was disabled by default.
This makes it consistent with the contributions feed when Change-Id: Ie33e2ba90e7a7566d0e0925220b8fd12b1928513 is merged.
For these changes feeds it makes sense to always link to the actual diffs.

See also bug 10268.

Change-Id: I0917844219be773ce24b4c6bac9b7d0d5a4b922d
2014-05-10 16:01:12 +00:00