Commit graph

1417 commits

Author SHA1 Message Date
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
Alexandre Emsenhuber
d02030505e Fix for r106476: forgot to remove debugging code 2011-12-16 20:57:15 +00:00
Alexandre Emsenhuber
9e892c7fd8 Per Aaron, fix for r105764: only set the timestamp if it's set in the cached ParserOutput object 2011-12-16 20:55:54 +00:00
Jeroen De Dauw
267eed076f follow up to r106215 r106218 106219 unless my search failed again, this ought to be the last one 2011-12-14 18:49:39 +00:00
Jeroen De Dauw
026e477128 fix depracted method usage 2011-12-13 22:24:38 +00:00
Jeroen De Dauw
a62e242a30 revert r106095, fix apparently not this simple 2011-12-13 21:34:16 +00:00
Jeroen De Dauw
29e81897f9 logName -> getName 2011-12-13 21:17:32 +00:00
Jeroen De Dauw
8e21d59caa fix deprecated method usage 2011-12-13 19:51:54 +00:00
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Alexandre Emsenhuber
2629c3649f * Added revision's timestamp to OutputPage along with revision ID; avoid a DB hit in Skin::lastModified() when showing parser cache's content. This changed with the removal of $wgArticle in Skin since now it's a different WikiPage object and thus WikiPage::setTimetstamp() call is useless (but still kept).
* Added ParserOutput::(get|set)Timestamp() and the $mTimestamp member; avoid messing with isset()
2011-12-10 16:30:40 +00:00
Tim Starling
ddbf20c0ba Add a configuration variable to work around the issue that has been reported at least twice on IRC: pages from MW with a 404 status code have the last block of their body replaced, and their headers appended to, resulting in totally broken output for page views of non-existent pages. BizLand or some reseller is probably at fault. 2011-12-09 04:31:10 +00:00
John Du Hart
0de3082ca4 Adding new debugging toolbar
Needs a UI cleanup still, but for the most part is working.
2011-12-04 18:29:57 +00:00
Roan Kattouw
00bad0cf9b (bug 32230) Expose wgRedirectedFrom (title of the page we were redirected from, if any) in JavaScript. Patch by MrBlueSky 2011-11-30 12:43:10 +00:00
Chad Horohoe
7914b2ee68 (bug 29475) Remove "trackback" feature entirely from core. This has been disabled-by-default since its inception and nobody uses it.
If someone really really wants this, they can write an extension.

Language files need rebuilding, but I took care of En and messages.inc.
2011-11-23 17:14:03 +00:00
John Du Hart
216d661d3b Bug 29524 - Rename RequestContext::getLang to getLanguage
I'll be amazed if this doens't break any tests.
2011-11-21 16:13:21 +00:00
Roan Kattouw
792c38f424 (bug 26854) Invalid user names go unchecked. Applied most of the patch submitted by Søren Løvborg, checking for null return values from User::newFromName() 2011-11-20 10:55:58 +00:00