Commit graph

199 commits

Author SHA1 Message Date
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
Demon
1dc986a90f Merge "[FileRepo] Made getDescription() respect *_deleted fields." 2012-06-04 20:41:52 +00:00
Alexandre Emsenhuber
799a291c70 Select all nedded fields for Title::newFromRow() when fetch a revision from the database.
Otherwise MW will throw an exception with the message "LinkCache doesn't currently know about this title"
when accessing redirect or len items of these Title objects, e.g. in Special:RevisionDelete.

Change-Id: I07978145df78bddac894bdac087c5d62b03759b3
2012-06-02 18:39:20 +02:00
Aaron Schulz
37c2fde15d Merge "Revision::getTitle produce rev_id IS NULL query" 2012-05-31 17:06:50 +00:00
umherirrender
e778bf886c setTitle on a new null revision
Revision::getTitle will make a query against slave to load the title on
demand. But when there is a slave lag, the slave does not know the new 
revision id and the caller gets null back

Change-Id: Ia85866362715ba666d51106037e7771d6bf4a237
2012-05-27 17:47:29 +02:00
umherirrender
4a279515f4 Revision::getTitle produce rev_id IS NULL query
Seen on Special:NewPages: Linker::revComment is calling
Revision::getTitle, but the revision object has no id set.
This is another way to avoid a query per non-empty comment on
Special:NewPages, see gerrit 9003

Change-Id: I1786a4c13000f574c0f34fb59759bb2fc4117bcd
2012-05-27 16:39:04 +02:00
Aaron
9f6afeab0d [FileRepo] Made getDescription() respect *_deleted fields.
Change-Id: I1dd54611501d6747fb4ad6cbe6b58b0010b1d6d4
2012-05-25 16:00:49 -07:00
Alexandre Emsenhuber
d1f8640a3b Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ia45d0756cd84138da267bf1cbd1a58be7f28c6d1
2012-05-11 10:34:29 +02:00
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