Undeletion was broken twice:
1) originally, it failed silently, restoring revision entries with
the wrong number in rev_page.
2) I789e45bd restores an overly zealous sanity check, causing
undeletion to fail with a fatal error.
This change fixes both issues.
Change-Id: I796fe54e81773f7982ae9bc15ba30f2a2ee3f174
// if the page ID wasn't known, set it now
$this->mPage = $this->mTitle->getArticleID();
} elseif ( $this->mTitle->getArticleID() !== $this->mPage ) {
- // got different page IDs, something is wrong.
- throw new MWException( "Page ID " . $this->mPage . " mismatches the ID "
+ // Got different page IDs. This may be legit (e.g. during undeletion),
+ // but it seems worth mentioning it in the log.
+ wfDebug( "Page ID " . $this->mPage . " mismatches the ID "
. $this->mTitle->getArticleID() . " provided by the Title object." );
}
}
return Status::newFatal( "undeleterevdel" );
}
}
+
+ $newid = false;
+ $pageId = $article->getId();
}
$revision = null;
// unless we are specifically removing all restrictions...
$revision = Revision::newFromArchiveRow( $row,
array(
+ 'page' => $pageId,
'title' => $this->title,
'deleted' => $unsuppress ? 0 : $row->ar_deleted
) );