Commit graph

190 commits

Author SHA1 Message Date
Sam Reed
2d25a902e3 More of r113580 2012-03-11 22:05:54 +00:00
Jeroen De Dauw
abfdd0b617 fix doc 2012-02-13 19:13:30 +00:00
Sam Reed
09a78c1368 More return documentation 2012-02-09 21:36:14 +00:00
Alexandre Emsenhuber
0effbbca5c Select fields returned by Revision::selectPageFields() and call Title::newFromRow() instead of Title::makeTitle() in Revision::getTitle() so that it doesn't need a separate query to load the page id or the latest revision id. 2012-02-07 19:24:31 +00:00
Alexandre Emsenhuber
3c1fee1a7f Fixed string -> __METHOD__ in calling method parameter 2012-02-05 20:29:53 +00:00
Alexandre Emsenhuber
c6e1f399a5 Added 'page_id' to the fields returned by Revision::selectPageFields() so that the Title object created in Revision::__construct() already knows its id and it doesn't have to issue another DB query to load it (happens e.g. in api.php?action=parse&oldid=... calls) 2012-01-31 10:26:22 +00:00
Alexandre Emsenhuber
b1d0376c1e Fix bug 32948:
* {{REVISIONID}} and related variables are no longer blank after doing a null edit
* {{REVISIONID}} and related variables are no longer blank after calling action=purge&forcelinkupdate
2012-01-21 07:59:25 +00:00
Niklas Laxström
cd12049d41 @since, ping r101030 2012-01-13 21:50:13 +00:00
Alexandre Emsenhuber
a5ae31d045 Use wfTimestampNow() instead of wfTimestamp() without second parameter 2011-12-29 20:45:47 +00:00
Jeroen De Dauw
0b105ebf1d added missing deprecation notices 2011-12-13 19:51:03 +00:00
Sam Reed
d4c27f5c0b Fix:
PHP Notice: Undefined property: stdClass::$ar_sha1 in Revision.php on line 127
2011-12-13 16:57:02 +00:00
Chad Horohoe
08bcda145b Self-revert r105872, there's a deeper issue here 2011-12-12 13:45:33 +00:00
Chad Horohoe
3ce2ffe405 (bug 32984) ar_sha1 might not be set 2011-12-12 13:11:54 +00:00
Aaron Schulz
4b9c7efd8e Fix r101294: newNullRevision isn't using selectField() or the like...it needs to specify sha1 2011-10-30 20:32:11 +00:00
Aaron Schulz
a4c1ae1ba0 FU r101021: made newNullRevision() re-use the sha1 of the reference revision 2011-10-30 00:55:35 +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
Aaron Schulz
5dfe3d6444 Revision objects now always use the current name of users, loading it on demand if necessary (e.g. when given a $row with no user_name but rev_user is not 0) 2011-10-21 23:20:52 +00:00
Aaron Schulz
b3e0ca374d * Simplified r100286 by just using the field 'user_name' and removed the COALESCE
* Simplified contribs pager with Revision::selectFields()
2011-10-20 03:03:45 +00:00
Aaron Schulz
981bdc1187 FU r100300, r100286:
* Updated link batch code in MergeHistory
* Marked some Revision functions explicitly public
2011-10-20 00:41:48 +00:00
Aaron Schulz
5db15361bc FU r100286: Added sanity check to fetchFromConds() join conds 2011-10-19 23:56:48 +00:00
Aaron Schulz
bbf11e8cf0 * Tweaked Revision class to handle loading the current user name instead of rev_user_text. It still falls back to rev_user_text when building objects from DB rows for b/c.
* Moved JOIN conds to fetchFromConds() as that's where the tables are specified. This lets us avoid the same page_id=rev_page join conds plastered all over the code. Also, we can't mix WHERE and JOIN style join conds.
* Removed duplication in fetchFromConds() by using selectPageFields().
* Removed duplicate rev_parent_id field from contribs SELECT.

Yo make use of these changes, Pagers and lists still need to be updated to use Revision::selectUserFields() and join on the user table.
2011-10-19 22:25:26 +00:00
Aaron Schulz
59e2f3e091 Code cleanups & fixed strange comma 2011-10-19 21:21:20 +00:00
Alexandre Emsenhuber
0da17a29c3 * Added User paremeter to Revision::userCan(), Revision::userCanBitfield(), LogEventsList::userCan(), LogEventsList::userCanBitfield(), File::userCan() and its subclasses so that they can check against any user instead of always $wgUser.
* Updated callers that have a context or may use another user than $wgUser
* Revision::getUser(), Revision::getUserText(), Revision::getComment() and Revision::getText() also have a User as parameter, but it will be used only when Revision::FOR_THIS_USER is passed in the first parameter
2011-10-12 15:09:04 +00:00
Sam Reed
937fc3bcfd Back out r95396 and friends 2011-09-29 22:08:00 +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
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
86c7992100 * Added Revision::getSha1 function
* Try to populate mSha1 when a Revision is made from an array (as rev_len does)
2011-08-12 17:29:57 +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
Sam Reed
b85469eceb Whitespace and comment updates 2011-08-05 16:05:41 +00:00
Sam Reed
704bcb4781 Add @since to Revision::newFromRow per Nikerabbit
Follows up r93935
2011-08-05 12:29:39 +00:00
Sam Reed
71ce734b14 Adding Revision::newFromRow() function as alias for new Revision()
More consistent with how we do stuff everywhere else
2011-08-04 23:25:34 +00:00
Sam Reed
a2bf7c35f7 Tweak/add to documentation
Remove old compat constants for "1.6 compatibility"
2011-08-03 00:19:27 +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
e880aed65f Fixed newFromArchiveRow to check for ar_page_id 2011-07-25 18:19:48 +00:00
Alexandre Emsenhuber
419021ebf0 Removed some error suppression operators 2011-07-08 18:17:02 +00:00
Aaron Schulz
cc7eac0320 Fixed bogus $conds in r91327 2011-07-01 23:46:20 +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
794dc8dffb Fix for r90429: removed call to protected method 2011-06-20 07:45:19 +00:00
Sam Reed
ba2c3a793d And even more documentation in various files 2011-05-29 14:25:20 +00:00
Sam Reed
b15737fa83 And even more documentation, the last of this batch 2011-05-28 19:00:01 +00:00
Mark A. Hershberger
0a49fd69b0 Misc EOL w/s and spaces-instead-of-tabs fixes. One day I'll get around to nagging people for this stuff, but for now, I'll JFDI myself. 2011-05-25 15:39:47 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Sam Reed
15df9a9d5c Kill off the long deprecated $wgInputEncoding and $wgOutputEncoding globals 2011-05-06 22:09:47 +00:00
Sam Reed
21d35067b9 Kill some more long deprecated unused functions
Add more @deprecated since where appropriate
2011-05-06 21:09:34 +00:00
Happy-melon
d40bad43f8 Type hinting and documentation tweaks. This file is actually pretty good... 2011-04-25 17:34:30 +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
Aaron Schulz
0414f53cd4 Made revText() give deprecated notice 2011-04-10 06:07:34 +00:00
Sam Reed
a59446dd48 Fixup a couple of parameter documentation bits 2011-02-11 22:06:46 +00:00