Commit graph

1432 commits

Author SHA1 Message Date
jeroendedauw
dc8f3e6c78 Added a pile of missing brackets
Change-Id: Id7b331e1b12875736c8e7e93660e71630360a723
2012-09-27 21:46:22 +02:00
Aaron Schulz
850373ba9c Merge "Use WikiPage::makeParserOptions() where possible." 2012-09-16 18:02:56 +00:00
Siebrand Mazeland
21b592d1ad Replace deprecated methods.
Also updated code formatting.

Change-Id: I188b5d29c9496383df10c391b29e9d26e59e8aeb
2012-09-08 00:28:16 +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
Alexandre Emsenhuber
900383ae18 Use Status::getWikiText() instead of getErrorsArray() in Article::doDelete()
So that the usage of the Status class is more consistent with other places.

Change-Id: I8f7944905df7bc241b21f014d8544486ea012f6b
2012-08-22 20:42:27 +02:00
Siebrand Mazeland
8d4913ec4d Replace deprecated wfMsg* calls with Message class calls.
Change-Id: Ifa80db1d81b9b9d1a5adfcac06a9ed14203c100e
2012-08-19 22:08:08 +02:00
Alex Monk
2fabea7eea Use wfMessage instead of deprecated wfMsg*
Or $this->msg in special pages.

Change-Id: I774a89d646615053c8424050e42ad95601f92543
2012-08-18 14:11:05 +02:00
Dereckson
8d68833208 (bug 37638) Remove calls to deprecated LogPage::logName method.
The LogPage::logName method has been deprecated in 1.19,
warnings being planned in 1.21.

This change removes any call in the MediaWiki core to this
deprecated method.

Removing extra whitespaces/tabs in includes/ProtectionForm.php.

Change-Id: I1907f17341ecb6448967a5283e3c913778dcb1a9
2012-08-15 07:50:01 +00:00
Aaron Schulz
180208751f Merge "Follow-up SVN r98012: pass Title objects to LogEventsList::showLogExtract()." 2012-08-07 20:58:45 +00:00
Alexandre Emsenhuber
d24a4d7f10 Use a better message when a revision is not found.
This comes from
https://translatewiki.net/wiki/Thread:Support/MediaWiki:Missing-article
that asks for a link to the deletion log in the
'missing-article' message.

Instead of simply changing that message I replaced
it with two news messages 'missing-revision' when trying
to view an old revision and 'difference-missing-revision'
when showing a difference. This removes the "lego"
construction of 'missing-article' with 'missingarticle-rev'
and 'missingarticle-diff' submessages.

I had to keep current messages since they are still
used in extensions.

Change-Id: Ibe60c84cfea922a78b3ad22cc48185a109cd617d
2012-08-06 10:53:53 +02:00
Alexandre Emsenhuber
7cb2a29392 Follow-up SVN r98012: pass Title objects to LogEventsList::showLogExtract().
It seems that I forgot to update Article.php in that revision.

Change-Id: Ia29cc62dc88abb7f58d5f8cec68f67b126763f6f
2012-08-05 11:44:22 +02:00
Alexandre Emsenhuber
388ea8dc28 Mark the history link on page deletion as known.
Two reasons:
- the page must exists to reach this part of the code
- it's useless to have special classes (redirect, stub)
  since this a link to the history and not to the
  content itself

Change-Id: I59af2f237e0539842cc7777ddd44ba5ac500b070
2012-08-02 14:06:20 +02:00
Alexandre Emsenhuber
34362e12bd Use Linker::linkKnown() instead of Linker::link() with options in Article.
Change-Id: I01a69bc76a9904859c3baf04b19659de7edf5348
2012-07-29 21:46:11 +02:00
Alexandre Emsenhuber
73e6b5db37 Use WikiPage::loadPageData() to reload data from the master.
There's no need to do this using custom code when we already
have methods for this.

Change-Id: I348dd9a01322b7e9b521e7a014959e91254dd2aa
2012-07-25 12:22:47 +02:00
Alexandre Emsenhuber
58c2c579d9 Pass the local User object to Revision::userCan()
Change-Id: Iffd857a577593642464371a988b7b7829d246748
2012-07-24 18:28:03 +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
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
Aaron Schulz
18dc076fa2 Merge "For consistency of the interface, don't do expensive checks on page view." 2012-06-19 06:53:07 +00:00
Reedy
0597984bd8 Fixup some wrong documentation
Don't try and return the result of void functions

Change-Id: I7a4db738b3e3052aebcf43742d31753f8cc1f47a
2012-06-15 15:05:49 +01:00
Alexandre Emsenhuber
243a7aa451 Use local context instead of hidden dependencies on global variables.
Change-Id: I342f14a404c57de3fc33ba1ecc846b700b38a419
2012-06-11 22:44:03 +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
Platonides
abce6ed742 Replace calls to deprecated Article::doWatch and Article::doUnwatch
Change-Id: I7e87b24144cbff01fdf8b40c5e7da783c0c57f24
2012-06-03 15:41:57 +02:00
Alexandre Emsenhuber
72b54dbf96 For consistency of the interface, don't do expensive checks on page view.
Change-Id: I4dfda5e286d5d78965469410f39504a211624dee
2012-05-31 10:03:46 +02:00
mrbluesky
1aead61d4c Add and fix comments in some includes files
Change-Id: If781ad1a9eeba8310cef97dc9786685e8b265fa1
2012-05-24 20:42:56 +02:00
Alexandre Emsenhuber
44ec396481 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ife63db5d36d833de4e0944f9b79ab0f80e7b84c5
2012-05-22 20:43:10 +02: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
Kaldari
a986772e98 Fixing fatal error - you can't call getUser on a WebRequest object
Change-Id: I323e9c39cd89673b7e369df3b77573e51f4ea2e3
2012-05-07 16:34:09 -07:00
Aaron Schulz
240ac2341e Merge "ImagePage refactoring" 2012-05-03 19:13:53 +00:00
Max Semenik
a67d5c46e2 ImagePage refactoring
* Use context everywhere
* Fix comments, including two functions from other files it references
* Remove pointless function return value

Change-Id: I29a0a2a54432c8ef7185a210c7f2f73c64bfb71c
2012-04-30 18:43:56 +04:00
Alex Monk
e02bea0f8b Done a bit of deglobalisation.
Change-Id: Id6e5e18b7bcaecd042528fdb37774a64e439e907
2012-04-24 15:40:37 +01:00
Alexandre Emsenhuber
6cc0e69e74 * (bug 34841) Fix for r103502: don't show edit links when display old page versions 2012-03-14 16:04:21 +00:00
Alexandre Emsenhuber
b2a94c5819 Let's be consistent and use the same check to show an the deleted version and cascade the parameter 2012-03-09 20:37:44 +00:00
Alexandre Emsenhuber
48e7066622 No need to create a new Revision object if we already have one available 2012-03-09 20:26:08 +00:00
Alexandre Emsenhuber
08efa9be88 Use WikiPage::getRevision() instead of another Revision object if the oldid parameter corresponds to the page's latest revision 2012-03-09 14:50:39 +00:00
Andrew Garrett
938871aa56 Port (with changes) r110866 to trunk. Reviewed by Brion before commit. 2012-02-13 22:32:44 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Alexandre Emsenhuber
e0e8f92227 * (bug 33967) "Previous revision" and "Newer revision" links now display the correct revision
(No RELEASE-NOTES entry since that's a 1.19-only bug)
2012-01-29 19:05:04 +00:00
Alexandre Emsenhuber
c17e35a503 Fix method name in comment: Article::followRedirect() -> WikiPage::getRedirectTarget() 2012-01-08 17:34:28 +00:00
Alexandre Emsenhuber
418b3503b1 * Added WikiPage to RequestContext and related so that it can be shared to avoid creating a new object each time and thus avoiding database queries to load the state of the object
* Added Article::getPage() as accessor to the WikiPage object so that it can be set in the context from MediaWiki::initializeArticle()
* Use it WikiPage::main() to call doViewUpdates()

I'm doing to this now so that I can revert r105790 and use the WikiPage object before the 1.19 release
2012-01-06 20:00:04 +00:00
Alexandre Emsenhuber
e0d00b1ccc Per Nikerabbit, fix for r107637: added @since 2012-01-05 19:05:02 +00:00
Alexandre Emsenhuber
605873cc92 Use $wgUser instead of the User from the context in Article::view() and Article::showDiffPage() for consistency 2012-01-02 17:16:10 +00:00
Alexandre Emsenhuber
9a97ae018a Removed useless call to Title::getArticleID(); let WikiPage::doDeleteArticle() do this itself 2012-01-01 14:16:09 +00:00
Alexandre Emsenhuber
dd2cfee331 * Removed usage of Article where possible in EditPage
* Added Article::getRevisionFetched() and use it in EditPage instead of accessing the member directly
2011-12-30 16:12:46 +00:00
Alexandre Emsenhuber
585141ece9 * Use Linker::getRevDeleteLink() where possible to remove code duplication
* Pass the User object to Revision::userCan() in Linker::getRevDeleteLink()
* Return the result Linker::revDeleteLinkDisabled() in Linker::getRevDeleteLink() instead of storing it in a variable that will not be used
2011-12-28 18:41:36 +00:00
Alexandre Emsenhuber
61734aed90 Per Reedy, fix for r107386: fix usage of undefined variable 2011-12-27 21:16:20 +00:00
Alexandre Emsenhuber
4f68ae8939 * Integrate $wgDeleteRevisionsLimit in Title::getUserPermissionsErrors() (only if doing expensive checks)
* Moved WikiPage::estimateRevisionCount() and WikiPage::isBigDeletion() to Title and marked those WikiPage methods as deprecated (only call in extensions removed in r107385)
* Show an error message when deleting a page to move another one in Special:MovePage and the deletion fails due to permissions errors (previously the form would simply show again)
* Cache the result of Title::estimateRevisionCount() since it's called two times when showing the deletion form and the user doesn't have 'bigdelete' right (one for the permissions check and the other when showing the number of revisions)
2011-12-27 15:29:44 +00:00
Alexandre Emsenhuber
46c5d3edad * Merged WikiPage::updateRestrictions() and Title::updateTitleProtection() into WikiPage::doUpdateRestrictions(); older methods still work for backward compatibility, but marked Title::updateTitleProtection() as deprecated and for removal in 1.20 since no extension calls it
* Removed permissions check from WikiPage::doUpdateRestrictions() and left it for callers, resolves the todo from documentation
* Inverted $expiry and $reason parameter between WikiPage::doUpdateRestrictions() and WikiPage::updateRestrictions() for more consistency; WikiPage::doUpdateRestrictions() also requires all parameters to be passed
* WikiPage::doUpdateRestrictions() returns a Status object instead of bool for the older one; only possible error at the moment is a read-only database
* Updated core calls to these functions
* Made maintenance scripts using it simply protect all actions returned by Title::getRestrictionTypes() instead of hardcoded 'edit' and 'move'
* This also means that protect.php can be used to protect a non-existing page for creation
2011-12-18 16:01:31 +00:00