Commit graph

19 commits

Author SHA1 Message Date
Aaron Schulz
8f15bc8ec9 Restore TitleMoveComplete by-reference flags to avoid errors
They should be removed from extensions, but they don't
really hurt much for now.

Change-Id: I64b570e376062155afdf879c3ce85560127c6792
2015-10-27 18:15:39 +00:00
Aaron Schulz
9e51328790 Convert MovePage to startAtomic()/endAtomic()
* This makes moves of a page and its subpages atomic
  as one operation. Note that $wgMaximumMovedPages
  already bounds the number of page rows changed.
* The TitleMoveComplete hook will fire for all
  titles after the operation rather than after
  each title move.
* Remove LocalFile comment about it commiting the
  transaction because LocalFile::lock()/unlock()
  check trxLevel() and reference count.

Change-Id: Ic7f6964f94f0b0f0bedc27012e5b5b012a4afdb2
2015-10-21 18:34:26 +00:00
jenkins-bot
f6b7ffab94 Merge "Migrate move protect log to new log system" 2015-08-18 23:17:03 +00:00
umherirrender
3964b4cc05 Migrate move protect log to new log system
Migrate the move protect log as first sub type of the protection log,
because it does not have complex log parameter, which needs some way of
handling/migration.
It also keeps the gerrit change smaller and hopefully makes review
easier.
The other sub types of the protection log will be migrated in a later
patch set.

This allows use of gender on Special:Log. Old message is kept for use
in IRC. A test was added to ensure an unchanged IRC message.

Bug: T47988
Change-Id: I57b3bd8a7dc823acdbb56520d2364f5542283373
2015-08-18 22:20:35 +00:00
Kunal Mehta
0ce88ddfb2 Populate rev_content_model when a move causes default content model to change
If the default content model changes due to a page move, a NULL in
rev_content_model will now reference the new default, which is not how
the revision was serialized, causing an exception to be thrown.

This was caused by a5bc9f49cd, since previously NULL would use the
correct, but techncially inaccurate, page_content_model.

Bug: T105260
Change-Id: I0c29d0e657ad0b656e5da6ba365f337229ad4dfd
2015-07-24 15:58:22 -07:00
Kunal Mehta
75c813cc9a MovePage: Move target existence check into isValidMove()
The target existence check is not dependent upon the user who is making
the move, so move it into MovePage::isValidMove() instead of
MovePage::checkPermissions() which not all callers will call.

Bug: T97536
Change-Id: I3aad1455ad4c064cbeaf35221a00ca6baba97c33
2015-04-29 10:36:03 -07:00
Aaron Schulz
5085a4b5cf Made wfFindFile/wfLocalFile callers use explicit "latest" flags
* Callers that should not use caches won't
* Aliased the old "bypassCache" param to "latest"

bug: T89184
Change-Id: I9f79e5942ced4ae13ba4de0b4c62908cc746e777
2015-03-06 04:18:50 +00:00
Amir E. Aharoni
5238644610 Shorten long lines in MovePage.php to make phpcs pass
Change-Id: I4b6b2975f8e2b9508f0a78fb176093974c935cf1
2015-03-03 22:02:23 +00:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
jenkins-bot
c39aefd439 Merge "Fix fatal error in I0349cfe0e322" 2014-11-04 06:53:31 +00:00
This, that and the other
60fd612e0e Fix fatal error in I0349cfe0e322
Change-Id: I4ac41d56c2e0f98cd8f026c7deac1e8ab69e8d54
2014-11-04 17:44:19 +11:00
jenkins-bot
a5aa9f0b95 Merge "Update article count when pages are moved" 2014-11-04 06:25:07 +00:00
This, that and the other
f6f390cc7a Update article count when pages are moved
If a page is no longer countable (or becomes newly countable) after a move,
we need to update the site statistics (count of content pages).

Bug: 64333
Change-Id: I0349cfe0e32229706e01d654aacf8ccbe5ebabf3
2014-11-04 17:13:21 +11:00
Kunal Mehta
ac53e45035 Fully replace Title::moveTo() with MovePage
* AbortMove hook is removed in favor of two more specificly focused
  hooks: MovePageCheckPermissions and MovePageIsValidMove.
** MovePageIsValidMove is for extensions to specify whether a page
   cannot be moved for technical reasons, and should not be
   overridden.
** MovePageCheckPermissions is for checking whether the given user
   is allowed to make the move.

* Title::moveNoAuth() deprecated
* Title::moveTo() deprecated
* Title::isValidMoveOperation() broken down into
  MovePage::isValidMove() and MovePage::checkPermissions().

* Title::getTitleProtection() is now public, and returns
  unprefixed fields

Change-Id: Ic5026384b92a0d68d628397ffe1de6e5b6183f02
2014-10-28 12:52:36 -07:00
Kunal Mehta
e995e2ae4b MovePage: Properly return errors
Probably a copy-paste mistake when converting this function
to use Status instead of error arrays.

Change-Id: I796fc66ee637dd7d914a4182fe56992e59b90aba
2014-10-10 22:52:13 -07:00
umherirrender
df24b7209d Fixed spacing
- Added newline at end of file
- Removed double spaces/newlines
- Added space after if/function and parentheses/brackets
- Removed space before comma/cast
- Fixed indent of some lines

Change-Id: I29867ffdffdfb7d2b56997e9393497c7dc12f7d3
2014-09-29 20:46:19 +02:00
Kunal Mehta
39fffcedb0 Move non-user specific things from Title::isValidMoveOperation() to MovePage
Change-Id: Ieffeb0c7a15b202dcbdaf2a9d0b9bcdc10e360d2
2014-09-19 20:11:59 +00:00
Kunal Mehta
52f1d0d7b3 MovePage::move(): Return a Status object
Change-Id: I17e6f6d36ae2052bd09d21eb94546d94bda9bce9
2014-09-14 19:31:38 -07:00
Kunal Mehta
77698193f9 Start moving page move logic out of Title
This moves most of the Title::moveTo() function into a new MovePage
class, and the entirety of the Title::moveToInternal() function.

No actual code was changed except for requiring a User object in
function arguments instead of relying up on $wgUser, and changes
to "$this" as necessary.

Change-Id: I5479fa8f3920a51ddf789d55edae7dd0d9b24382
2014-09-14 19:29:53 -07:00