Commit graph

268 commits

Author SHA1 Message Date
daniel
b5b2b2f898 (Bug 41574) Supply Title object to Revision if possible.
The Revision object needs the Title to determine the default content model.
Providing the Title explicitely wherever possible avoids an extra database
lookup. Most importanlty, this fixes fatal errors that ocurr when the
database lookup fails due to slave lag or transaction state.

Change-Id: I516e82f7a893b274c513b128b8a46db491160b55
2012-11-01 13:48:18 +01:00
daniel
8498a4f575 (Big 41436) Make sure Revision knows page Title.
With $wgContentHandlerUseDB, Revision needs access to the page's Title
object to determin the page's default content model. This apparently
failed in production for newly created pages (supposedly because of
some complication with database transactions or master/client setup).

This change makes WikiPage::doEditContent pass the Title object
directly to the Revision to avoid any database issues. This also
gets rid of a pointless database read.

Change-Id: I9db228c3fcda0f8dfe52be1659014a6e4b4775af
2012-10-29 16:31:16 +01:00
Antoine Musso
9362bb6c56 miscellaneous doxygen warnings
* @licence -> @license
* Protects inline HTML by using double quotes, our inline comments uses
  elements such as <h1> or <firstnameLastname@gmail.com>
* Commands in lowercase (@TODO -> @todo, @NOTE -> @note)
* removes @abstract and @static since doxygen detects them from PHP
  code.
* various undocumented function parameters
* typos in parameters declarations

Change-Id: I62ad6fc124c355bf31acc780b9614a59cf79a421
2012-10-22 14:00:08 +02:00
daniel
3d6e9faab5 (bBug 41127) Handle non-existent content in WikiPage
Change-Id: I8b80a6b7b49b0b8b43eb7d4913860d8ca899015e
2012-10-18 15:13:01 +01:00
daniel
8c9a4d8bbb [Bug 41030] fix fatal error when rendering non-existing pages
Change-Id: I68dc34aa7d4c27ea7d0fb9488324d0f899564960
2012-10-15 14:36:03 +02:00
Aaron Schulz
5fec9caec7 Merge "Silence warnings about deprecation by ContentHandler." 2012-10-13 00:03:31 +00:00
daniel
09c607f7b9 Silence warnings about deprecation by ContentHandler.
The introduction of the ContentHandler caused quite a few functions and hooks to
become deprecated. Usage of these has been removed in core, but is still present
in extensions. Extensions should be fixed after ContentHandler has settled in a
bit, but for now we need a way to silence the warnings.

Change-Id: Ia223243222675f778e8f8c32923f956790db0b4f
2012-10-12 14:56:02 +02:00
Siebrand Mazeland
4b62b0339c Prefix new ContentHandler hooks in WikiPage with Page instead of Article
Covers 3 hooks:
* ArticleContentInsertComplete -> PageContentInsertComplete
* ArticleContentSave -> PageContentSave
* ArticleContentSaveComplete -> PageContentSaveComplete

Change-Id: I186669a5941d8982725ed364b481215d291b2043
2012-10-11 18:22:52 +02:00
daniel
bb51a58e57 Cleanup of Wikidata branch.
This cleans up several issues raised in comments to I3b2dad3a,
mostly style and merge artifacts.

Change-Id: I99f5e300a671db1353db151cd187ffd2e4478d03
2012-10-08 17:34:47 +02:00
daniel
c546fae8ed merge latest master into Wikidata branch
Change-Id: Id4e0f40c03679c13d8934a6add99b5cd86d0437d
2012-10-08 13:58:54 +02:00
daniel
7db9491d89 set mediawiki version number
Change-Id: I3479776bd3bb25c4d75d07e62ede2ad989025c5b
2012-10-05 15:03:24 +02:00
daniel
fe27182d64 Use canonical parser options per default
Change-Id: I2cbfaab2e15d9a1c1061f9ea31c7a8ebbeffdbd0
2012-10-04 13:00:05 +02:00
daniel
8f479e2e45 Add parameters to ArticleDeleteComplete.
Supply more information about the deleted revision to hook functions.

Change-Id: Ie1fc967d074deb918c824e10398bcb0ec2d557ac
2012-09-20 21:15:43 +02:00
daniel
b6b686c13b merged master
Change-Id: I0ef7c7f33a5dc5855f38b20c03ddc5306f38ec66
2012-09-19 12:34:10 +02:00
Alexandre Emsenhuber
726f30786f Forward the User object from WikiPage to Revision.
This affects the following methods of WikiPage:
- getText()
- getUser()
- getCreator()
- getUserText()
- getComment()

These are wrapper to methods in the Revision class
that accept an optional User object as second parameter
in the case FOR_THIS_USER is passed as first parameter.

Change-Id: I81a2470378bc1134dd144743d376ba31f4fe13d1
2012-09-18 22:44:58 +02:00
Liangent
9573209efc (bug 37453) Move $wgDisable(Lang|Title)Conversion to ParserOptions
This allows easier fix of bug 37453, and patch to fix it is
included in this changeset.

Change-Id: I9096534639394755d0a296dea7380e7b938befef
2012-09-16 20:20:36 +02:00
Aaron Schulz
850373ba9c Merge "Use WikiPage::makeParserOptions() where possible." 2012-09-16 18:02:56 +00:00
daniel
be43796499 Comment cleanup
Change-Id: Ie41f680782502f2b70c1bdbf18da3ee790d48fe7
2012-09-13 16:21:54 +02:00
daniel
4e80be15d4 Introducing ContentHandler::canBeUsedOn()
ContentHandler::canBeUsedOn() is called by WikiPage::doEditContent
to determine whether the requested kind of content can be used
on the present page.

Change-Id: I37b0e42eea2376b7485581f779b2520caa3b7fe2
2012-09-11 15:39:57 +02:00
daniel
12166f46b4 merged master (2012-09-11)
Change-Id: I8e953eaa22f9d331b0af5e780fbeff6d702b23e3
2012-09-11 11:43:02 +02:00
daniel
b6fe213226 merge latest master.
some tests fail due to logical changes, will fix that in a follow-up

Change-Id: I8a5e4087ecf674fbcf6327c5d168cd401be12400
2012-09-05 17:50:13 +02:00
daniel
e87534c1f5 Don't clone content, may need state
Change-Id: I5dacb1e9fce225f581829d229713d51abfae36f1
2012-09-03 16:53:14 +02:00
Siebrand Mazeland
475a1daa03 Replace some occurrences of wfMsg* by alternatives. Undeprecated wfMsgReplaceArgs.
* wfMsgReplaceArgs isn't really i18n related. It just replaces text parts.
* Updated language.txt. Now refers to mediawiki.org.
* Removed deprecated Block::formatExpiry(). Merge Id7d057a4 first.
* Reformatted weirdly formatted array in ApiBase.php.
* Removed wfMsg() in RandomTest.php.

Change-Id: Ied5cfda8fa5d9283dfeebdcb0e1af8453d47e7a9
2012-09-03 11:49:58 +02:00
Alexandre Emsenhuber
be0878fd3a Use WikiPage::makeParserOptions() where possible.
- 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
2012-08-31 23:16:03 +02:00
daniel
9994968774 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 15:20:15 +02:00
Daniel Kinzler
392af46809 Revert "merged master"
This reverts commit 67bfdc7a68
2012-08-29 13:14:49 +00:00
daniel
67bfdc7a68 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 12:06:38 +02:00
daniel
425ae715aa Merge "Fix error display on failing rollback" into Wikidata 2012-08-29 10:02:26 +00:00
daniel
96f7db3f7b Avoid deprecation warnings in test cases.
a) when testing deprecated functions, use $this->hideDeprecated() to
suppress warnings.

b) use doEditContent() instead of doEdit()

Change-Id: Ifa9e0ef373ed72ef7d4a3c2dd558483af4a3fd55
2012-08-28 16:00:39 +02:00
daniel
41842bc71b Fix error display on failing rollback
Rollback will now show the actual errors that caused it to fail,
instead of a misleading message about permissions.

Also, errores returned by WikiPage::doEditContent are now propagated
and shown.

Change-Id: I5a3f8cb7a0b881d07d52f63504dd3757192205a9
2012-08-27 21:40:03 +02:00
Siebrand Mazeland
01788cddd3 Replace deprecated wfMsg* calls with Message class calls.
Last round of easy replacements. About 30 uses in core remain (outside of HISTORY
and GlobalFunctions::wfMsg*). I'll work with IAlex and Nikerabbit to work towards
getting rid of those, too.

Updated method documentation in a few places.

Change-Id: I2491c006b62a9cc183230e31a0bd96c91e5b6142
2012-08-27 20:44:47 +02:00
Aaron Schulz
d106a244f3 Merge "change raw database quoting to use addQuotes" 2012-08-26 18:53:20 +00:00
umherirrender
bd8b22d90f change raw database quoting to use addQuotes
Change-Id: Ia734f958b1458224f998c5b59df2ff49e597f868
2012-08-26 18:56:29 +02:00
umherirrender
f483c453d0 Truncate rollback summary for whole multibyte characters
This avoids broken characters for long comment in history

Change-Id: I3104d53c1d3d9b950e23dccecf5cea36561b8c65
2012-08-26 18:32:34 +02:00
daniel
74fe09ed4d Bug 39509: Function for running legacy hooks.
ContentHandler::runLegacyHooks can be used to run hooks that don't
supprot Content objects yet. runLegacyHooks will issue a warning and take
case of serialization/unserialization of the content as appropriate.

Changeset 2: rebased.

Change-Id: I31109061110f87c38bdeebf30d520c8e1241bb29
2012-08-20 22:00:52 +02:00
daniel
0139923580 fixing long lines
Change-Id: Iebcd40a1a37a3a93cc571fa2c2b0a87f53dc97a4
2012-08-20 21:33:07 +02:00
daniel
29719f846b merging latest master
Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
2012-08-20 16:55:28 +02:00
umherirrender
aff21af9ae Allow aliased field names with separated syntax
This introduce the syntax from aliased table names for aliased field
names into the abstract database layer:

array( 'alias' => 'field' ) gives 'field AS alias'

This patch also includes changes to query pages, api and some more
places to show, how the new syntax looks in "production".

This allow us to remove the "AS" for Non-PostgreSQL databases, if we
want that.

Change-Id: I5f0de1c2f29092c173aec3de93ffdef436799e8d
2012-08-15 15:16:09 +02:00
Alexandre Emsenhuber
7281c50794 Fix documentation of WikiPage::doDeleteArticle(Real)?()
- The $suppress parameter is a boolean indicating whether
  revision will be suppressed
- Added @since to WikiPage::doDeleteArticleReal()

Change-Id: I3af14f8cc7bf771f4d07215ca1dba2d6b6f05553
2012-08-13 16:09:25 +02:00
Aaron Schulz
1690388847 Merge "(bug 12701) Use diff of all unseen revisions in the "new messages" bar." 2012-08-09 16:59:57 +00:00
Aaron Schulz
eb183bac87 Revision and WikiPage cleanup with IDBAccessObject interface.
* Replaced WikiPage::DATA_FROM_* constants with IDBAccessObject ones.
* Renamed IDBAccessObject constants a bit for visual consistency.
* Removed AVOID_MASTER parameter and replaced calling instances with READ_NORMAL.
  Instead of getting page_latest from the master and the revision from a
  slave, just get it all from the master in one RTT. Most callers used
  AVOID_MASTER (and now READ_NORMAL), so this case is barely hit anymore.

Change-Id: Ifbefdcd4490094b38e49bbb46c95fdb71b5c9e1a
2012-08-08 16:34:08 +00:00
daniel
c0b50eb47d merged master
Change-Id: I6afafe971afb3f38fc8f1e66ba409283b8a698f8
2012-08-02 11:01:22 +02:00
Aaron Schulz
bdb20afd70 Merge "Fix for I5211ec50 (d969a27): more refactoring of the code." 2012-07-26 21:49:49 +00:00
daniel
086f719116 fix WikiPage::getDeletionUpdates() for cases where no content object is present.
Change-Id: Idbd8dd9a4f84f45acfe1a4388653990cf191a33b
2012-07-24 17:51:28 +02:00
daniel
3403216446 ported fix for bug 37225 to getContent()
Change-Id: Ia51742ba717b352d79734550510ad4af6fa47ba6
2012-07-24 12:57:19 +02:00
jeroendedauw
45d45dc7ee Comment out call causing an error and assigning to an unused var anyway
Change-Id: Ib7ce5f53b05449ae2d80f5e7ade3a634263c0d9a
2012-07-24 11:34:01 +02:00
daniel
8d280dde9b Moved getParserOutput to Content interface.
On Tim's request, this change moved getParserOutput() and getSecondaryDataUpdates()
from the ContentHandler to the Content interface.

Change-Id: Ia654aa8710a242ba5fe7a4eb528e6a6449035f59
2012-07-23 23:52:34 +02:00
daniel
c8e633f1e3 moved getDeletionUpdates to Content interface
Change-Id: I1b46b1d663f8efd609aeb1b63cb07ee1a0a00c33
2012-07-23 22:54:25 +02:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00
daniel
83540622de Merge branch 'Wikidata' of ssh://gerrit.wikimedia.org:29418/mediawiki/core into Wikidata 2012-07-23 13:20:17 +02:00