Commit graph

76 commits

Author SHA1 Message Date
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
Jeroen De Dauw
0b105ebf1d added missing deprecation notices 2011-12-13 19:51:03 +00:00
Alexandre Emsenhuber
87ebe89bed Moved view count from WikiPage to Title; avoids an extra DB query when showing the view count in SkinTemplate::outputPage() (since it's not the same WikiPage object) 2011-12-11 11:30:11 +00:00
Alexandre Emsenhuber
81ea10b635 * Changed WikiPage::exists() to call Title::exists()
* Changed some getId() calls to exists() and call that method directly on $mTitle
2011-12-10 09:35:03 +00:00
Tim Starling
71e27e22de * Revert r103476, r105161 and implement the fix for bug 32858 (a.k.a. bug 32450) in WikiPage instead. See comment 14 for further rationale.
* Clarified release notes. Please write what the new code does, not the bug description.
2011-12-09 10:32:55 +00:00
Platonides
0461342d2c Unused $wgParser. Fix comment 2011-11-30 23:06:18 +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
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
Alexandre Emsenhuber
e725d56451 Fix for r103502: make PoolWorkArticleView::doWork() return true when the parse is successful; also fixed getIsDirty() to return the member parameter and not try to execute a non-existing function 2011-11-18 07:10:03 +00:00
Alexandre Emsenhuber
dd58309f1a * Added WikiPage::getParserOutput() and changed Article::getParserOutput() to use it
* WikiPage::getParserOutput() requires a ParserOptions object (and optionally the revision ID) instead of an User object, removes an hidden dependency on $wgLang. For this reason, WikiPage::isParserCacheUsed() now also uses a ParserOptions object instead of an User object (doesn't change anything in the code except the variable name and it's not called in extensions)
* Moved PoolWorkArticleView to WikiPage.php and added an entry in the AutoLoader and moved output-related stuff directly in Article::view() so that in can be shared with WikiPage::getParserOutput() (removes code duplication, etc.)
* Added the revision ID to the PoolCounter key so that it knows which revision is being parsed and doesn't wait for another parse operation with same options but different revisions
* Removed Article::doViewParse(), Article::tryDirtyCache() and Article::getOutputFromWikitext() since they are now integrated in PoolWorkArticleView and Article::view() and there are no callers in extensions. This also fixes a bug since Article::doViewParse() will get another ParserOptions instance with special options set in Article::view() not be repercuted.
* Updated DifferenceEngine to use the new system
* Updated docs/memcached.txt to correct method names
2011-11-17 20:21:54 +00:00
Mark A. Hershberger
171ac0a31b Apply cryptocoryne's patch from Bug 32454 - ArticlePurge hook is broken after r86041 2011-11-17 16:00:41 +00:00
Alexandre Emsenhuber
610d68c3c3 * Put the LinkCache update in WikiPage::updateRevisionOn() so that we are sure that it is executed every time that function get called (and the update succeeds of course); and removed the call to Title::resetArticleID() which is already done by insertOn()
* Also update $this->mLatest and $this->mIsRedirect in updateRevisionOn() (will use this in ApiEditPage to have to create another istance just to grab the new revision ID)
* In WikiPage::doEdit(), get the current latest before going through the process since it's now updated in updateRevisionOn() (would break RecentChange::notifyEdit() otherwise) and pass the current redirect state to use the optimisation in updateRedirectOn() if possible
2011-11-16 21:03:06 +00:00
Alexandre Emsenhuber
018d885f64 Deprecated WikiPage::preSaveTransform() in favour of Parser::preSaveTransform() and updated callers; added wfDeprecated() call since there are no callers in extensions 2011-11-15 21:46:05 +00:00
Alexandre Emsenhuber
81be80e6ac Some cleanup to Article::view() and related:
* Moved the page check if oldid was given from Article::fetchContent() to Article::getOldidIDFromRequest() so that it's done directly when executing Article::view(); this should not happen though for normal view requests since oldid and related are checked in MediaWiki::parseTitle()
* Removed $oldid parameter from Article::fetchContent() and always use the oldid parameter passed either in the constructor or the request; also changed call from Article::loadContent() to Article::fromContent() since the former is now only a redirect to the latter
* Moved the 'read' permission check to the beginning of Article::view() since the Title is now correct directly after calling Article::getOldID()
* Merged the two calls to the parser cache and make WikiPage::isParserCacheUsed() also return true when the latest revision id is given. Article::setOldSubtitle() is still called when the oldid is passed to display the "You are view the current revision of this article".
* Also moved the non-existing page check a bit up to avoid running a good part of useless code when the page doesn't exist
* Merged two calls to Title::quickUserCan( 'edit' ) to set edit sections to false
2011-11-14 18:05:55 +00:00
Aaron Schulz
6c4360c951 Make use of Title::isSpecialPage() in various places 2011-11-02 20:55:08 +00:00
Aaron Schulz
65bd11feb9 * Made mRedirectTarget, mLastRevision, mTimestamp, mTouched of WikiPage protected; no outside users.
* Added TODO comment to doRollback() and fixed mLatest comment.
2011-10-31 19:50:51 +00:00
Mark A. Hershberger
8e65a9e093 Fixes Bug #6793 — “New Variable __NEWSECTIONS__ like __TOC__” by
adding Nx.devnull's patch that adds a hook needed by
Extension:PlaceNewSection.
2011-10-27 23:55:29 +00:00
Aaron Schulz
eac8538cd6 * Added pageJoinCond() and userJoinCond() to Revision and exposed them publicly
* Removed commented-out code
2011-10-27 19:55:00 +00:00
Aaron Schulz
c326cab516 Reinstated r94289 et all - rev_sha1/ar_sha1 field for bug 21860 2011-10-27 18:44:10 +00:00
Sam Reed
6906724935 Add, update, tweak documentation
Fix document comment blocks

Tweak some returns
2011-10-26 03:45:13 +00:00
Alexandre Emsenhuber
109e5113c0 Removed unused and deprecated global declaration of $wgDeferredUpdateList 2011-10-24 16:17:46 +00:00
Alexandre Emsenhuber
bd548f36e9 * Changed ParserOptions to store a Language object instead of only a string, avoids object -> string -> object conversion
* ParserOptions::getUserLang() will still return a string for compatibility, added ParserOptions::getUserLangObj() to get the object
* Added ParserOptions::newFromUserAndLang() and ParserOptions::newFromContext() to easily get a ParserOptions object when a context is available or when someone wants to force the language
* Updated OutputPage and Preferences to use newFromContext() and WikiPage to use newFromUserAndLang()
* ParserOptions::setUserLang() still accepts either a string or a Language object, but changed the calls to pass an object instead of a string
* Changed Parser::getFunctionLang() to return the Language object from ParserOptions when parsing interface messages rather than $wgLang directly and updated the documentation to say that $wgLang should not be used directly (as $wgUser, $wgTitle and $wgRequest)
2011-10-19 14:16:01 +00:00
Sam Reed
825483edbc Remove some more code after r98467 2011-10-18 21:47:51 +00:00
Sam Reed
d90b987ade Fix whitespace, braces
Fix return items
2011-10-15 22:58:42 +00:00
Aaron Schulz
1fccf7ae25 Call loadPageData() with 'fromdbmaster' in doEdit() to avoid old slave data 2011-10-04 18:40:13 +00:00
Sam Reed
5fb5356d75 And another brace... r98467 2011-09-29 22:16:00 +00:00
Sam Reed
937fc3bcfd Back out r95396 and friends 2011-09-29 22:08:00 +00:00
Aaron Schulz
f9075cff41 FU r98421: forgot to move mParserOptions field 2011-09-29 17:54:19 +00:00
Aaron Schulz
669ecd8a94 Moved getParserOptions() crap back to Article.php due to $wgUser dependency. Callers updated. 2011-09-29 17:51:27 +00:00
Aaron Schulz
4436a31e43 Fix for r97091: Extensions can cause anons to have their own language settings. Distinguish anon options from canonical options. 2011-09-29 17:39:14 +00:00
Alexandre Emsenhuber
e20d79da7a Per OverlordQ, fix for r87164: let's use an aggregate function that exists in postgresql 2011-09-27 14:47:42 +00:00
Niklas Laxström
c49610741d Added LinkCache::addGoodLinkObjFromRow, since addGoodLinkObj is not going to work much longer when new parameters are added 2011-09-20 15:19:18 +00:00
Sam Reed
20e414d311 Fix indenting of a couple of braces 2011-09-16 11:35:56 +00:00
Platonides
3c208f005e Remove @param for argument removed in r97206. 2011-09-15 21:29:53 +00:00
Platonides
1e4a90bdda Follow up r89706, building up on r97091.
I think this should fix the issues while 
keeping bug 14404 solved.
We may need now a more advanced test than
ArticleTablesTest::testbug14404() thoigh.
2011-09-15 21:09:04 +00:00
Aaron Schulz
ea57223bfe FU r89706: Cleaned up getParserOptions duplication problems 2011-09-14 19:57:41 +00:00
Aaron Schulz
567a49991a Fixed WikiPage::newFromId to use the factory() function 2011-09-14 17:51:37 +00:00
Aaron Schulz
bd84f54ff1 Added @todo items 2011-09-14 17:15:07 +00:00
Niklas Laxström
c48b41201a Revert r96798 - makes parser go infinite loop somewhere 2011-09-14 11:23:58 +00:00
Niklas Laxström
a9c243b7b5 RevisionDeleter:
* Fixed comment of getChanges and made it public
* Removed getLogMessage and expandMessageArray, now unused
LogFormatter:
* Cache parsed parameters locally, since this function is going to be called few times for every log entry
DefaultSettings:
* Could not find any use of suppress/file log
LogPage:
* Removed old formatting code, now unused
WikiPage:
* Converted (suppress|delete)/delete logs to new format

Added DeleteLogFormatter, handles part of suppression log as well.
Updated messages.
This also addresses bug 18578.
2011-09-14 10:36:24 +00:00
Robin Pepermans
9a6efcc3e4 (Bug 30364) LanguageConverter should depend on the page content language instead of the wiki content language. Remains largely the same, except for extensions using the PageContentLanguage hook like Translate and WikimediaIncubator.
* Made variant tabs hidden on special pages (has no or sometimes wrong/inconsistent effect there; plus it's mainly in the user language)
* Made redirects be in content language again (remove from Title->getPageLanguage())
2011-09-11 17:56:27 +00:00
Chad Horohoe
22b599e06c Refactor deferrable updates into classes & interfaces, also add helper method for the most common use case:
$wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, "sometable" );

I kept b/c with $wgDeferredUpdateList for now, but seeing as only 3 exts in svn use it (FileSearch, FlaggedRevs and WikiScripts), I'd like to deprecate it pretty soon :)
2011-09-10 06:50:30 +00:00
Aaron Schulz
cce7fcf367 For r91123:
* Moved generateReason() to WikiPage. This fixes the PureWikiDeletion ext too.
* Make Checkpoint ext call getRawText() as doEdit() does. Aalso, WikiPage doesn't have fetchContent().
* Call getAutosummary() statically in doEdit().
* Fixed outdated code comment.
* Fixed title used in unit test.
2011-09-07 17:55:37 +00:00
Roan Kattouw
3827fe3e72 Some comment and whitespace fixes 2011-09-07 12:54:57 +00:00
Alexandre Emsenhuber
341a999f2b Removed unused global declaration of $wgMessageCache (!) 2011-08-30 12:24:12 +00:00
Sam Reed
44020e254c Merge the iwtransclusion branch back into trunk
Hexmode fixed broken unit tests in revisions after last time
2011-08-24 13:03:03 +00:00
Sam Reed
afa82f68b2 * (bug 30450) Clear page_props table on page deletion
Also clear them on a move over redirect

Modified delete() calls in doDeleteArticle to pass __METHOD__ for the function name
2011-08-18 23:37:04 +00:00
Brion Vibber
95300b2e55 Followup r94541 (reverts of r94289 undiscussed core schema change and followups), two more that got missed: reverts of r94290, r94364 2011-08-15 18:52:33 +00:00
Aaron Schulz
1689b6ec10 Follow-up r94289: code changes to fill the new fields on insertion and select them 2011-08-11 21:54:46 +00:00
Victor Vasiliev
d636fac2d8 Allow extensions to add pages with non-wikitext display by adding two new
hooks (generalizing the code already used for CSS/JS pages).
2011-08-11 17:21:31 +00:00