Commit graph

29 commits

Author SHA1 Message Date
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
Rotem Liss
eac74f1650 Add direction mark in recent changes and in protection log summary. 2011-08-02 09:09:23 +00:00
Sam Reed
183d2dab37 Back out r93533, r93531, r93530
Breaks unit tests as below, not going to be able to fix them before I disappear for the evening, so might aswell leave trunk clean

ArticleTablesTest testbug14404

Error:
ArticleTablesTest::testbug14404
Undefined offset: 0

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/ArticleTablesTest.php:31
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60

ParserTests testParserTest #552 - testParserTest with data set #551

Failure:
ParserTests::testParserTest with data set #551 ('RAW magic word', '{{RAW:QUERTY}}', '<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
</p>', '', '')
RAW magic word
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
+<p><a href="/index.php?title=Template:RAW:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:RAW:QUERTY (page does not exist)">Template:RAW:QUERTY</a>
 </p>

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/parser/NewParserTest.php:545
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60
2011-07-30 15:56:54 +00:00
Sam Reed
dc9d39887e Merge iwtransclusion branch into trunk 2011-07-30 15:30:01 +00:00
Aaron Schulz
7ccf3c85fb Fixed r93468, made setCachedLastEditTime() public 2011-07-29 17:56:32 +00:00
Aaron Schulz
d4337ba10e * Follow-up r93093: set the touch key for page moves too
* Tweaked related WikiPage.php comments
2011-07-29 16:44:22 +00:00
Aaron Schulz
d84d6f7188 (bug 28553) Set ar_parent_id on deletion 2011-07-26 16:41:02 +00:00
Aaron Schulz
eca50fb4b8 Follow-up r79518: added getCachedLastEditTime/getCachedLastEditTime methods to WikiPage and check them in loadPageData() to see if we should hit the master. This should lower the risk of stale data (by not just relying on cookie/session master position waiting). 2011-07-25 19:24:43 +00:00
Sam Reed
ead9055a62 Update code comments that point to 1.18 to point to 1.19 2011-07-18 23:01:08 +00:00
Sam Reed
fcebee405f Add comment
Remove unused wfGetDb()
2011-07-18 22:23:42 +00:00
Aaron Schulz
0b1eb48108 Made WikiPage::factory a bit more dummy proof 2011-07-14 17:39:04 +00:00
Aaron Schulz
7f0b8463c8 Added 'fromdbmaster' param option to WikiPage::loadPageData() 2011-07-13 19:14:18 +00:00
Aaron Schulz
6a1aef21b6 Follow-up r91997, moved newFromTitle() function to WikiPage.php and renamed to factory(). This avoids an extra class. 2011-07-12 20:32:09 +00:00
Brian Wolff
3a6fd361ce (Follow-up r91414) Also take the page name in account when considering how much of page to put in auto-summary.
Move limit from 200 bytes to 250 bytes - 5 left over just cause (+4 bytes for the $1 and $2). The other auto-summary still uses 200 as the limit (I suppose they don't want it too big or soemthing?).
2011-07-06 00:24:59 +00:00
Brian Wolff
1fa782d4fd (bug 29109) Allow the automatic edit summary for redirect creation
show the first bit of the new redirect page.

Adds $2 to the autoredircomment (not used by default) that contains the first 150-ish characters of the newly created redirect page.

Meant so that the Wikipedian's can see their {{R from foo}} templates.
2011-07-04 17:03:09 +00:00
Aaron Schulz
b8f545ff48 Moved doCascadeProtectionUpdates() to WikiPage.php 2011-07-02 17:45:32 +00:00
Alexandre Emsenhuber
70dbd60d7e The User object parameter of WikiPage::doRollback() and WikiPage::commitRollback() was not passed by the Article implementation because it was not present.
While I'm a it, WikiPage::doRollback() and WikiPage::commitRollback() now require that parameter, moved the check to Article.
2011-07-02 15:10:39 +00:00
Alexandre Emsenhuber
c63d52d967 Removed one hidden usage of $wgUser 2011-07-02 14:53:01 +00:00
Alexandre Emsenhuber
18346994ca Moved action=rollback to an Action subclass 2011-07-02 13:46:56 +00:00
Aaron Schulz
893d84b6aa * Fixed getLatest() check in Article
* Added Title::loadFromRow() function and made WikiPage::loadPageData() use it; avoids raw Title field accessing
* Added Revision::newFromPageId() function and changed WikiPage::loadLastEdit() to use it. This makes it try a slave first instead of always hitting the master. It also makes it more consistent with getLatest() for sanity.
* Made WikiPage::loadPageData() use accessor for Title::mRestrictionsExpiry
2011-07-01 23:33:34 +00:00
Alexandre Emsenhuber
cf6dd13fac * Changed action=revert to use a subclass of Action
* Added WikiPage::getActionOverrides() to be able to execute different actions depending on the namespace (obviously needed for action=revert). This is only used when the value of $wgActions for the corresponding action is true; so extension can still override this.
* Added Action::getDescription() to ease the change of the page header and the <title> element
2011-07-01 20:07:21 +00:00
Aaron Schulz
2c292086eb Follow-up r91123:
* Tweaked getRevision() return type to NULL on failure
* Changed "$revision === null" checks to just "!$revision" (this avoids the landmine of getting false or something)
2011-07-01 00:12:09 +00:00
Aaron Schulz
c82602778b * Marked WikiCategoryPage::hasViewableContent() as "public"
* Renamed WikiPage::getID -> WikiPage::getId
* Fixed undefined $changed var from r91180
* Various doc tweaks
2011-06-30 19:44:06 +00:00
Alexandre Emsenhuber
931bdf8d2d Fixes for r88113 and some realted changes:
* Modified <s>Article::editUpdates()</s> WikiPage::doEditUpdates() arguments to take a Revision object, an User object and options (much more readable that those boolean parameters)
* Call isCountable() on the old content and pass it to WikiPage::doEditUpdates() with the 'oldcountable' option so that it really reflects the old state of the page
* Updated all calls (no one in extensions) and removed the wrapper WikiPage::editUpdates()
* Call onArticleEdit() and onArticleCreate() (the one that is of course) from doEditUpdates()
* Removed $wgTitle hack from Import.php
2011-06-30 15:26:26 +00:00
Aaron Schulz
6c2f1f06a2 * Fixes for r91123:
** Avoid calling protected pageDataFromId() from Article class.
** Made pageDataFromTitle()/pageDataFromId() public for anything else doing something like that (loadPageData was already public anyway).
** Moved getParserOutput() back to Article since it needs getOutputFromWikitext().
* Other: cascading protection side-effect moved to outputWikiText().
2011-06-30 07:52:59 +00:00
Aaron Schulz
8abddb4f6b Expand on r91123 Article refactoring:
* Added $user param to relevant WikiPage functions (with b/c)
* Cleaned up editUpdates() signature and tweaked three other WikiPage functions signatures (with b/c)
* Added fixme to prepareTextForEdit()
2011-06-30 07:05:20 +00:00
Aaron Schulz
930ccf282c * Split off WikiPage class from Article, WikiFilePage class from ImagePage, and WikiCategoryPage from CategoryPage.
* WikiPage functions/fields are "magically" part of Article when accessed for b/c. Magic is kind of ugly but there are too many callers to make breaking changes atm. Some functions are just wrappers for WikiPage ones (were magic won't work).
* Added newFromID() to each WikiPage subclass (works around pre-existing inheritance problem).
* Added Page class for convenient type hinting and changed hints from Article -> Page. This lets things use WikiPage objects without getting type errors.
* Updated FlaggedPage to extend WikiPage. Worked around getOldIdFromRequest().
* Added setTimestamp() to WikiPage and moved some timestamp setting code from ParserCache to Article.
* Removed ampersands from $dbw arguments.
* @TODO: dependency inject user objects for WikiPage

The idea is to migrate things to use WikiPage, as the run-of-the-mill "new Article()" call doesn't care about $oldid and $wgRequest. After that, Article, ImagePage, and CategoryPage can be rewritten as an Action class or something sane (a Viewer class of sorts).
2011-06-29 22:09:51 +00:00