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
action=parse&prop=modules now provides the ResourceLoader modules used
on the page (included in the ParserOutput object). This is intended to
be used by the live preview functionality.
Bug: 24134
Change-Id: Ib5032e4eeaf6bb97dac965c580a5107437c7bbd4
These files have all had treatment before, and these occurrences have either
been missed or have been introduced after.
Change-Id: I06cdab4616b5bff47c85152df28f18c861730a23
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I758fa4ad80ac95e2ddd3770bcb9b7d2e57ec34ea
This allows the get the limit report in provided uselang and not only
the english version out of the parsed html.
Change-Id: I2efc606623190756f5c993f48ef29bb0d384a95b
The documentation states that if contentmodel and title are not given,
but text exists, "wikitext" will be the default model. However, the
actual code will show a warning if do so. This patch fixes the inconsistence
by removing some parts of the documentation which encourages giving
only text as the parameter and corrects the example. The patch
also suppresses the warning that contentmodel must be given when
summary parameter is given.
bug: 60192
Change-Id: I0f41c83763fbb5551aa3ceaff59c1f8fe38310be
Iec98e472 had broken this. Use the same strategy as in
MediaWiki::initializeArticle to work around the problem.
Bug: 49477
Change-Id: Ib272b1f9395f6adade505ac7c6a24f9a4bff2779
Fixed a little documentation issue, removed a line of unreachable code
and fixed up two formatting issues in the process.
Change-Id: If29391ee1a0daf19973437f36c3216b8716debd0
Also whether the category page exists, since we can get that basically
for free along with the 'hidden' flag.
Bug: 54884
Change-Id: I5c435f04b1b3b65c4153dea1767d48b49ed427c2
The documentation for action=parse needs clarification, particularly in
light of the changes made in Ie4f7324c which were too hastily merged.
Also, add the RELEASE-NOTES entry missing from Ie4f7324c.
Change-Id: Ia8847f7e99620a9f7af24956d972c882f78aae26
action=parse was raising an error about missing 'text' with 'title' even
when 'title' wasn't actually passed, due to a fix for bug 33865. But
this broke using action=parse to parse an edit summary without also
giving it wikitext to parse.
Instead, let's give the client a warning (unless it seems clear they
know what they are doing) and assume the empty string for 'text'.
Also, while we're editing the file, add some more examples as also
requested in bug 48319.
Bug: 48319
Change-Id: I03c1fbcb0bd31dea8bd84e164104f7ced0ace449
In https://gerrit.wikimedia.org/r/#/c/67266/, it was enabled automatically
when a section was specified in preview mode. However, this only works for
previews of a saved page's content, failing for user input previews which
might contain several sections of various degrees of nestedness.
Change-Id: I987144e5e315ed9e0a67f599083461a78879c0df
This adds a new hook called LanguageLinks which is called
whenever a list of language links is returned to the user.
This gives extensions the option to manipulate the links
on the fly.
Note that this change only covers the language links used
in OutputPage and by ApiParse. Adapting ApiQueryLangLinks is
left as a follow-up task.
As explained on bugzilla, this is a precondition to
allowing Wikibase/Wikidata to update languagelinks without
forcing a (redundant) re-parse of the page content.
This change also introduces the notion of link flags that
can be used to associate flags with language links. This
will be integrated with ParserOutput and OutputPage in a
follow-up.
Change-Id: Iaec0faa131413a291fc8f77496e4f371addb3b99
See bug 44341 for action=parse, but the problem with interwiki
processing can also be happen in other modules.
This gives clearer error message on some modules
For example action=move:
Bad title "*title*"
instead of:
Unknown error: "immobile-target-namespace-iw"
Change-Id: I86524533dfd778a169b39968999918a1f531efeb
For historical reasons, all our API class had a dummy __construct which
simply calls their parent constructor. This patch removes all such
occurences to save out some bytes.
Change-Id: I667955d7821f780fc5ce23823d74dedb1729b9fa
API was using SVN's version keyword which GIT does not support.
All related methods were either removed, or for those that
could have been used from extensions, emptied out.
api.php?version now shows unrecognized param warning.
Change-Id: I910ca1448ed2ed697ac19b17c486d130aa1d7e03
It's now possible to use uselang with the watch API without
it throwing a warning (cause the parameter wasn't defined).
Idea and some code taken from ApiParse.
Change-Id: I74b7c4286c0c2f44fabc337d5fb744560f71cf71
Changeset Iec98e472 changed the behavior of action=parse&page=... when
passed a page that does not exist: previously, it would return a
"missingtitle" error instead of assuming an empty page. As some people
had been depending on this old behavior, restore the error checking.
Change-Id: I4c76ce458ceb01e233c6074cd9251879013ec143
- This is needed to for I90965346 ((bug 37453) Move
$wgDisable(Lang|Title)Conversion to ParserOptions)
because that change sets an option based on the Title,
and I don't want to duplicate that to all ParserOptions
that need it.
- Refactored ApiParse to have a WikiPage object available
and changed some part to take advantage of having this
object available. Also used ApiBase::getTitleOrPageId()
to reduce code duplication.
Change-Id: Iec98e472af9c43d940f77261367a796b0d7b4b54