Commit graph

1099 commits

Author SHA1 Message Date
Aaron Schulz
10c37d58fe Revert "Purge Squid variant pages based on page language (not $wgContLang)" per CR comments. I merged this one too quickly.
This reverts commit 0f9b9d5144
2012-06-03 21:07:58 +00:00
Liangent
0f9b9d5144 Purge Squid variant pages based on page language (not $wgContLang)
Change-Id: I36a55d0de33dd199513b94741b1833e8e0543b95
2012-06-04 01:39:55 +08:00
Brion VIBBER
0d22edd27b Merge "Revert "Adding sanity check to Title::isRedirect()."" 2012-06-03 11:03:20 +00:00
Brion VIBBER
d7f7a6234b Revert "Adding sanity check to Title::isRedirect()."
This reverts commit 7d12b7b72c
2012-06-03 11:00:54 +00:00
Aaron Schulz
2f3004af8e Merge "Adding sanity check to Title::isRedirect()." 2012-05-29 17:29:19 +00:00
daniel
7d12b7b72c Adding sanity check to Title::isRedirect().
isRedirect() assumes that the LinkCache already contains
information about this title. If that is not the case, it
currently returns false, even though it just doesn't know
whether this link is a redirect.

The new check asserts the assumption that this title
is already known to the link cache.

Amend: use Exception instead of assert()

Change-Id: Id3ad2d4e140b270b1f5ca1f7af9b3320cffff5a2
2012-05-29 15:39:43 +02:00
umherirrender
beccc67e36 Title.php: replace some '*' with explicit fields in selects
It is good practice to select only fields, which are used later

Change-Id: I4e765d60aea3c11261497346a85e65ed755a085d
2012-05-25 16:55:25 +02:00
Aaron Schulz
2f5914c2ce Merge "Title::moveToInternal doesn't return anything, but it does throw an exception" 2012-05-19 07:55:54 +00:00
umherirrender
7b8e963c88 empty string test for old page_restricions entries
some old page_restricions entries are move=:edit=,
which result in any empty string as level in the JS var
wgRestrictionEdit

Checking wgRestrictionEdit.length is than not possible

Change-Id: I250b4f9bda60361d4cd8c3139b17b299fec0a718
2012-05-16 21:14:40 +02:00
Alexandre Emsenhuber
2040d1337e Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ib46e50da4ec649a6a06cbeed00752effb79ed06e
2012-05-09 20:11:36 +02:00
Siebrand
a15243f15d Merge "Pass the result of the database queries in Title::getPreviousRevisionID() and Title::getNextRevisionID() into intval()." 2012-05-07 10:22:46 +00:00
umherirrender
fafd3e0b26 Use Title::legalChars()
Change-Id: I6b29f29875fa54196b5899042a8f576c82a8943f
2012-05-04 21:47:00 +02:00
Aaron Schulz
73737df4a4 Merge "Noticed while looking at $wgShowUpdatedMarker related database queries, queries not using index order at all. Fixed up" 2012-05-03 18:25:18 +00:00
Alexandre Emsenhuber
5e7c414018 Pass the result of the database queries in Title::getPreviousRevisionID() and Title::getNextRevisionID() into intval().
No idea why mysql_fetch_object() returns string when the field in defined as integer, but it is so on my machine...

Change-Id: I353c6087d20d7a72d6d4b39bdc477b094bc460f6
2012-05-02 10:52:51 +02:00
Reedy
5813680952 Few documentation/type hint updates
Change-Id: Ib2882cc03540403f74f68854fa76df375c1bb25a
2012-05-01 22:03:50 +01:00
Reedy
3f4e41a24e Noticed while looking at $wgShowUpdatedMarker related database queries, queries not using index order at all. Fixed up
Title.php at line 4313:
			array( 'wl_namespace' => $this->getNamespace(),
				'wl_title' => $this->getDBkey(),
				'wl_user' => $user->getId()
			),

In UserMailer.php at line 438:

array(
					'wl_title' => $title->getDBkey(),
					'wl_namespace' => $title->getNamespace(),
					'wl_user != ' . intval( $editor->getID() ),
					'wl_notificationtimestamp IS NULL',
				)

And line 455:

array( /* WHERE */
						'wl_title' => $title->getDBkey(),
						'wl_namespace' => $title->getNamespace(),
						'wl_user' => $watchers
					)

CREATE TABLE /*_*/watchlist (
  -- Key to user.user_id
  wl_user int unsigned NOT NULL,

  -- Key to page_namespace/page_title
  -- Note that users may watch pages which do not exist yet,
  -- or existed in the past but have been deleted.
  wl_namespace int NOT NULL default 0,
  wl_title varchar(255) binary NOT NULL default '',

  -- Timestamp when user was last sent a notification e-mail;
  -- cleared when the user visits the page.
  wl_notificationtimestamp varbinary(14)

) /*$wgDBTableOptions*/;

CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);

Change-Id: I633c009b4a1c614b966c69f042f94c2056e03784
2012-04-28 00:59:59 +01:00
umherirrender
4989ddd423 strip off subpages direct in GenderCache
LinkBatch can also give subpages to the GenderCache and therefor it is
easier to do it always in GenderCache, than in LinkBatch and Title

Add unit tests for GenderCache

Change-Id: Ia936ff8bb639a197b0b3a8e07c97a66edd57dd10
2012-04-21 10:34:22 +02:00
Reedy
9ae175d6c8 Title::moveToInternal doesn't return anything, but it does throw an exception
Means the evaluation of if ( is_array( $err ) ) { is always going to be false

Update the documentation

Change-Id: I0016495563e715a2a1927e227ec2bb5c80b5378b
2012-04-11 20:00:29 +01:00
Alexandre Emsenhuber
9eb25dc032 Check for namespace existence in Title::makeTitleSafe().
Namespace existence has to be checked before calling Title::makeName() because otherwise it will fallback to a page with the same name, but in the main namespace which is not what we want here.

Change-Id: I8c087390044c54dd0502c1b8bb9321dfaec6b5f7
2012-04-11 14:37:27 +02:00
Sam Reed
2d25a902e3 More of r113580 2012-03-11 22:05:54 +00:00
Alexandre Emsenhuber
880477b0ad * (bug 34937) Fix for r107636: call WikiPage::onArticleCreate() when moving a page an not overriding the redirect 2012-03-03 16:36:37 +00:00
Aaron Schulz
1a9061d900 [Title] In moveToInternal(), just use getParentId() on the null revision object as the base ID rather than $latest. They should conceptually be the same but the former was already fetched with master data. 2012-03-03 12:46:58 +00:00
Amir E. Aharoni
f42c131076 Fixes bug 34723: applies the English language to CSS/JS both as a user subpage and a MediaWiki space page, and consequently applies LTR to JS and CSS in the textarea. 2012-02-26 11:39:49 +00:00
Alexandre Emsenhuber
3219219c29 Per Aaron, follow-up r112036: add __METHOD__ to DatabaseBase::rollback() too 2012-02-21 22:04:43 +00:00
Alexandre Emsenhuber
44bc2e7cc2 Pass __METHOD__ to DatabaseBase::begin() and DatabaseBase::commit() 2012-02-21 19:56:43 +00:00
Sam Reed
c8eb4467f1 Fix user related direct member variable access 2012-02-16 00:54:34 +00:00
Robin Pepermans
542bae9af9 add warning note to isKnown() per r111017 2012-02-12 23:42:39 +00:00
Jeroen De Dauw
6479096233 follow up to r111017, move hook to isAlwatsKnown as per discussion on CR 2012-02-12 23:10:06 +00:00
Antoine Musso
d5d1585900 revert r111234 (deprecated methods removal)
Reasons invoked by Rob Lanphier are:
* ongoing code slush
* backwards compatilibility issues
2012-02-12 19:25:28 +00:00
Alexandre Emsenhuber
435c7eb616 Remove some methods marked for removal in 1.20 and update FakeTitle accordingly.
No more callers in core or extensions.
2012-02-11 14:36:36 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
09a78c1368 More return documentation 2012-02-09 21:36:14 +00:00
Sam Reed
0a626db6e1 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:29:36 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Sam Reed
f3cc77aaee Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:41:50 +00:00
Jeroen De Dauw
14d2728ea6 put in r110285 again now that 1.19 branched 2012-02-09 01:34:20 +00:00
Siebrand Mazeland
3bc0f8cf50 Revert r110285, r110286. No new features in core during slush.
Consider recommit after 1.19 is branched, and please add hooks.txt documentation, too.
2012-01-30 13:54:43 +00:00
Jeroen De Dauw
f024dbb70c follow up to r110285, fixed accidental newline 2012-01-30 12:54:17 +00:00
Jeroen De Dauw
29ceb0c78a add hook that allows changing the check to see if a page exists or not 2012-01-30 12:52:31 +00:00
Chad Horohoe
34368e9d2e Minor tweak to r109161, remove trailing "this" 2012-01-27 13:27:26 +00:00
Antoine Musso
f54bd020f9 deprecated $query2 in Title.php
$query2 was used to pass a variant. Make that deprecated, the
recommanded way is to use an array as a first parameter. Ex:

 $this->getLocalUrl( array( 'variant' => 'foo' ) );

Ping r105919
2012-01-17 16:42:53 +00:00
Aaron Schulz
5a6559d8b1 Reverted r108743 per CR comment. This should at least be discussed first. 2012-01-12 19:41:18 +00:00
Sam Reed
a5c200a25b Kill "* @return void" 2012-01-12 19:12:24 +00:00
Platonides
263cdf2791 Remove empty statement added in r108193 2012-01-07 22:49:46 +00:00
Alexandre Emsenhuber
99fde665ed Revert r105790 and move back view counter back to WikiPage with two modifications:
* WikiPage::$mCounter is now marked as protected
* Call WikiPage::loadPageData() from WikiPage::getCount() if the count is not set intead of loading the page_counter field only
2012-01-06 20:26:53 +00:00
Aaron Schulz
1d77bc94c2 * Cleanup for r108175: made if easier for extensions to interact with each other in TitleReadWhitelist hook. A handler can set $whitelisted to true to whitelist the page or it can set it to false and return false (most restrictive wins).
* Added some hook doc comments.
2012-01-06 06:16:05 +00:00
Alexandre Emsenhuber
7b96bc9010 Per request of Aaron Schulz, follow-up r102187: added new 'TitleReadWhitelist' hook to allow extensions to bypass core (and other extensions) checks to allow an user to read the page 2012-01-05 20:29:53 +00:00
Brion Vibber
0bbf9a45b0 Revert r107769, r107771, r107825, r107840, r107927, r107934
Title objects are meant to be dumb value objects; we shouldn't add to their internal state like this, but should be working to remove the bits already in there like the article ID.
Preloading information like this can make sense, but probably belongs in WikiPage, not Title.
2012-01-03 21:44:41 +00:00
Alexandre Emsenhuber
e40e80e74e Per Aaron, fix for r107771: Title::getTouched() should return false on non-existing page 2012-01-03 20:15:45 +00:00
Alexandre Emsenhuber
17230f6a4e Give Title a decent loading mechanism:
* Added Title::load() to factorise common code that load member variables instead of having each accessor doing it own loading system for its related member variable
* Removed usage of LinkCache::addLinkObj() to do the database query and do this directly in Title::load(). This allows to select the complete database row and populate all member variables; previously, requesting a field not stored in LinkCache (using getCount(), getTouched() or isNewPage()) results in two database query, one to load LinkCache data and the second to load the requested field; now there'll be only one query.
* Added Title::FIELD_IN_LINKCACHE and Title::FIELD_NOT_IN_LINKCACHE to specify whether the requested field is stored in LinkCache or not. LinkCache will be used if possible (i.e. Title::FIELD_IN_LINKCACHE is passed), otherwise a DB query to select the complete row is issued.
* Made Title::loadFromRow() save the row to LinkCache if possible.
* Added $wasFromMaster parameter to Title::loadFromRow() to tell that method whether the row was loaded from the master database or not and pass it from WikiPage::loadPageData()
* Added Title::GAID_USE_MASTER in addition to Title::GAID_FOR_UPDATE to get the row from the master database without having to do a SELECT FROM UPDATE query
* Added Title::selectFields() method to return the fields to select to given Title::loadFromRow() (and methods using it such as Title::newFromRow()) a complete row
* Made Title::$mCounter private since it has only been added recently (in r105790)
* Mark the object as loaded if Title::resetArticleID() is called with as new ID as 0
2012-01-03 19:28:03 +00:00