Commit graph

1275 commits

Author SHA1 Message Date
Alexandre Emsenhuber
5f2d7cf312 * (bug 28568) Entries in the iwlinks table are now removed on page deletion 2011-04-16 07:46:47 +00:00
Chad Horohoe
efe4525d2c Merge r81448 from REL1_17: reverting RevisionMove feature back out until somebody has the time to work on it again. Reverts r67094 and its followups in trunk: r67099, r67111, r67112, r67115, r67398, r81425, r81427 2011-04-15 23:28:13 +00:00
Aaron Schulz
11fbc49e36 * Pass around parser options instead of users and made some parser options consistency fixes
* Moved makeParserOptions to Article.php
* Renamed currentIncludeVersions -> getRevIncludes
* Renamed updatePageCache -> setPageCache
* Moved FlaggedRevs::getCacheKey up
2011-04-15 18:40:25 +00:00
Alexandre Emsenhuber
1573551d80 Fix warning: Missing argument 1 for wfDeprecated(), called in includes/Article.php on line 580 and defined in includes/GlobalFunctions.php on line 3094 2011-04-14 20:00:25 +00:00
Happy-melon
8779f4b55f r86001, now with less scariness :P I took out the delete action and did purge instead, which is a much more self-contained action-with-a-form. Also implement a few changes suggested by Brion on IRC last night. 2011-04-14 10:38:29 +00:00
Happy-melon
bc4a096805 Revert r86001: Brion says it's too scary :D will recommit in pieces 2011-04-13 23:36:27 +00:00
Happy-melon
6dc8136d12 New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
2011-04-13 23:04:07 +00:00
Aaron Schulz
837d39dec7 * Removed getSelectOptions, which did nothing other than send FOR UPDATE on some slave queries to barely used features
* Removed only Core use of forUpdate(); same issue
2011-04-13 00:50:44 +00:00
Happy-melon
66e176b153 Implement a $context and getContext/setContext methods for Article (and its subclasses). 2011-04-12 23:00:49 +00:00
Aaron Schulz
ea39c57260 Added pageDataFromId return type to docs 2011-04-12 20:26:56 +00:00
Aaron Schulz
b7bcf1b498 * Made pageDataFromTitle protected (unused elsewhere)
* Split out selectFields() for easier use of loadPageData()
* Marked Revision::selectFields as public (was used as such)
2011-04-12 20:21:16 +00:00
Happy-melon
38475c650b Clean up some direct $db->query($sql) calls. Remove limit/offset parameters from Article::getContributors() as they weren't being used anywhere and probably didn't work properly anyway. 2011-04-12 12:09:11 +00:00
Sam Reed
b30f86cd14 Revert r85785 2011-04-11 18:46:35 +00:00
Sam Reed
34ea507090 * (bug 13921) deadlocks mass-deleting media files in categories 2011-04-11 13:07:55 +00:00
Aaron Schulz
557bec802c * Removed some of the duplicated latest revision attribute fields (using mLastRevision instead)
* Added access level (raw/public/user) options to user, text, and comment accessors for latest revision
* Fixed minor related FIXME in FlaggedArticleView
2011-04-10 06:32:50 +00:00
Happy-melon
966372f4bb Add the revision-info and revision-info-current messages directly to the page, don't stick them in the content sub; this adds unwanted extra CSS styling which screws with the margin and font size. 2011-04-04 11:46:18 +00:00
Daniel Friesen
86583c7c8f Start better utalizing OutputPage as the focal point for things related to the output of the page. Like getTitle use $out->get{User,Skin} instead of $wgUser and $wgUser->getSkin() for things where the user or skin is being used for output generation back to $out instead of using globals with bad structure. 2011-04-03 03:59:47 +00:00
Mark A. Hershberger
289c1d7771 Fixes Bug #28214 - When page not found, sends malformed HTTP/1.x instead of HTTP/1.1 in header of respons
Note that there are a few places in the source where headers are sent
with HTTP/1.0 instead of HTTP/1.1 but this patch doesa not address those
2011-03-25 03:36:18 +00:00
Ryan Lane
99db57182f Follow up to r84638. Moving the $wgUser global, and fixing formatting. 2011-03-24 21:32:08 +00:00
Brian Wolff
2d64c69910 (follow-up 79778) Make $wgLang->truncate function consider the length of the ... (ellipsis message) in the truncation length.
The length of this message varries by localization, so the previous solution of telling truncate to truncate 5 bytes
less than needed is not good since this will be too little or too much.

Updated places where its used. Some places I left as is, as it looked like the new behaviour would work fine for them to.
(for example, the autosummary feature - it was cutting off at 200 bytes, which is no where near 250 limit, so I presume that
was for asethic reasons rather then to fit as much in before the db limit).

Will do another commit for extension callers in a moment.
2011-03-24 02:54:11 +00:00
Ryan Lane
2273857827 Removing pass by reference, and making the $error argument for doDeleteArticle a reference. Follow up for r84638. 2011-03-23 22:13:09 +00:00
Ryan Lane
308203304d Moving deletion hooks into doArticleDelete so that other code can sanely delete articles. Fixed other core code that was wrapping the calls with hook calls. 2011-03-23 21:54:59 +00:00
Happy-melon
6dbcdc1be0 Blame hashar for this giant commit; he teased me for making so many smaller ones earlier... :D
* Internalise $mAddress/$mUser, $mBy/$mByName, $mEnableAutoblock, $mId as getTarget(), getBlockers(), isAutoblocking(), getId().  
* This required editing AbuseFilter and CheckUser backwards-incompatibly, so push the rest of the changes out to those extensions.
* Attack the evil 14-parameter constructor and gratuitously-confusing newFromDB( $notVeryImportantParameter, $moreImportantParameter)
* Reimplement the hack for bug 13611 in a slightly less fragile fashion; could still do with further cleanup, but then again the login frontend is its own can of worms... :S
* Remove transitionary getTargetAndType() and newFromTargetAndType() methods
* Some optimisation in parseTarget()
* Fix the broken phpunit test mentioned in r84251
2011-03-21 19:12:41 +00:00
Max Semenik
55d6855e0e Removed Article::insertNewArticle() and Article::updateArticle() - deprecated in 1.7(!), unused 2011-03-21 18:41:46 +00:00
Happy-melon
21fcf991d0 Follow-ups to r84258 2011-03-18 22:28:39 +00:00
Happy-melon
ac5751ee48 Follow-up r84249: reimplement isAllowedAny(), and restore isAllowed() to only-accepting-one-parameter mode for the time being. 2011-03-18 21:07:05 +00:00
Happy-melon
91e7b5a93c More cleanup in Block.php. Push Block::encodeExpiry() and Block::decodeExpiry() deeper into the callstack, to DatabaseBase for encode and Language for decode. The vast majority of callers of these functions are not handling block expiries, but expiries generally, particularly page protections. 2011-03-18 19:15:56 +00:00
Happy-melon
81852ea1a6 Allow User::isAllowed() to take varargs. "is allowed X or Y" is by far the more common multiple permission check in core, so this is now the behaviour of isAllowed( X, Y ); also add isAllowedAll(...) for testing "is allowed X and Y". Has the nice side effect of adding visibility to a very old function. 2011-03-18 14:48:21 +00:00
Tim Starling
7222fb59d6 Revert r79122, causes bug 27891 (old version seen immediately after edit). 2011-03-14 04:26:52 +00:00
Happy-melon
3d161feebf Follow-up r83755: @deprecated @since is wrong, doesn't have the expected semantic meaning. 2011-03-12 18:14:33 +00:00
Alexandre Emsenhuber
33f66d157b Skip a part of useless code when redirecting because of getOldIDFromRequest() or showing a diff page 2011-03-12 14:21:41 +00:00
Alexandre Emsenhuber
08861c5638 Only call User::getSkin() when necessary.
(With this, a parser cache hit on action=render may not load the skin at all)
2011-03-11 14:31:12 +00:00
Mark A. Hershberger
b3df4babc2 misc w/s cleanups, “svn diff -x-w” clean 2011-03-08 18:12:17 +00:00
Alexandre Emsenhuber
a526d19f20 Follow-up r83240: seems people prefer returning false than the current version when no revision with given ID is found 2011-03-05 17:55:21 +00:00
Alexandre Emsenhuber
0c99ecc6f2 * (bug 27763) Article::getParserOutput() no longer throws a fatal given when an incorrect revision ID is passed 2011-03-04 20:16:35 +00:00
Sam Reed
28f7bf1f2b Followup r82727, improve comments, cast return value to bool 2011-02-24 16:00:06 +00:00
Ryan Schmidt
6bac96af7e * random redirect-related fixes:
** automatically add redirect=no to all links on the redirect page in Article::viewRedirect.
** properly check if redirects are enabled if $wgMaxRedirects < 1 (moved check from Title::newFromRedirectArray to Title::newFromRedirectInternal).
2011-02-22 16:39:17 +00:00
Platonides
dae94d2472 Follow up r63584. The change of resetArticleID() could have all kinds of
side effects, given that it stops lazy cache fillings.
2011-02-18 23:44:18 +00:00
Alexandre Emsenhuber
67d91714f6 * Don't use assignment in a condition check
* Pass the Title object so that it doesn't rely on $wgTitle
2011-02-17 17:06:06 +00:00
Mark A. Hershberger
b4cee86beb w/s fixups 2011-02-12 04:06:22 +00:00
Platonides
d9bcf39e34 Convert the if into an early exit. Whitespace ignoring diff recommended. 2011-02-10 17:13:12 +00:00
Platonides
49074e8a56 Yet more additions of wfProfileOut() 2011-02-10 16:39:53 +00:00
Daniel Friesen
b4d811d659 Fix bug slightly caused by moving legacy code out of the Skin class. The Article class was calling the legacy Skin::historyLink in a very ugly way (ie: having it's own mTitle, but relying on whatever title just happened to be set on the skin that it grabbed). 2011-02-08 01:15:50 +00:00
Alexandre Emsenhuber
136f4c06fa Deprecated wfMsgWeirdKey(), use wfMessage() instead. Moved getDefaultMessageText() from Article to Title so that it can be used there instead of duplicating code. No usage in extensions. 2011-02-05 15:11:52 +00:00
Alexandre Emsenhuber
61accbc57a Follow-up r81456: forgot to remove a global declaration 2011-02-03 15:31:38 +00:00
Alexandre Emsenhuber
a58b7f5139 * Use wfMessage() instead of wfMsgGetKey() and wfEmptyMsg()
* Factorise common code
2011-02-03 15:29:13 +00:00
Alexandre Emsenhuber
51c6afc751 * Replaced $wgMessageCache by MessageCache::singleton(); since we only use one instance of this class (as for ParserCache, LinkCache)
* MessageCache::singleton() calls wfGetMessageCacheStorage() directly instead of using $messageMemc, just in case this would be called before that variable is set
* Per TimStarling: also removed deprecated methods in MessageCache class: addMessages() and related, [get|set|enable|disable]Transform(), loadAllMessages(), loadMessageFile() and some others. Same for the legacyData stuff in LocalisationCache that was only used by MessageCache::addMessages() and related. 
* Converted remaining extensions
2011-01-26 15:42:04 +00:00
Robert Leverington
2a30aa1d25 Add new hook ArticlePrepareTextForEdit, called when preparing text to be saved.
Add new parser option "PreSaveTransform" that allows the pre-save transformation to be selectively disabled.
2011-01-16 21:12:26 +00:00
Alexandre Emsenhuber
151e665515 Added wfDeprecated() to Article::insertNewArticle() and Article::updateArticle(). The last usage of these two methods was removed in r80402. 2011-01-15 16:07:49 +00:00
Alexandre Emsenhuber
10c8ebb2e7 Added ArticleViewFooter hook to allow extensions adding additional items to the footer of normal views 2011-01-14 21:54:29 +00:00