$dbw = wfGetDB( DB_MASTER );
+ $oldpage = WikiPage::factory( $this );
+ $oldcountable = $oldpage->isCountable();
+
$newpage = WikiPage::factory( $nt );
if ( $moveOverRedirect ) {
wfRunHooks( 'NewRevisionFromEditComplete',
array( $newpage, $nullRevision, $nullRevision->getParentId(), $user ) );
- $newpage->doEditUpdates( $nullRevision, $user, array( 'changed' => false ) );
+ $newpage->doEditUpdates( $nullRevision, $user,
+ array( 'changed' => false, 'moved' => true, 'oldcountable' => $oldcountable ) );
if ( !$moveOverRedirect ) {
WikiPage::onArticleCreate( $nt );
* @param array $options Array of options, following indexes are used:
* - changed: boolean, whether the revision changed the content (default true)
* - created: boolean, whether the revision created the page (default false)
+ * - moved: boolean, whether the page was moved (default false)
* - oldcountable: boolean or null (default null):
* - boolean: whether the page was counted as an article before that
* revision, only used in changed is true and created is false
wfProfileIn( __METHOD__ );
- $options += array( 'changed' => true, 'created' => false, 'oldcountable' => null );
+ $options += array(
+ 'changed' => true,
+ 'created' => false,
+ 'moved' => false,
+ 'oldcountable' => null
+ );
$content = $revision->getContent();
// Parse the text
$title = $this->mTitle->getPrefixedDBkey();
$shortTitle = $this->mTitle->getDBkey();
- if ( !$options['changed'] ) {
+ if ( !$options['changed'] && !$options['moved'] ) {
$good = 0;
} elseif ( $options['created'] ) {
$good = (int)$this->isCountable( $editInfo );