Revert "Add assertions about page IDs during undeletion."
Completely breaks Special:DeletedContributions.
This reverts commit b019b9ee24.
Bug: T282844
Change-Id: If2dc77a12407307f83bb1f92b67d914efff95ae8
This commit is contained in:
parent
f45965450f
commit
d0a30ef04f
3 changed files with 1 additions and 18 deletions
|
|
@ -76,15 +76,7 @@ class RevisionArchiveRecord extends RevisionRecord {
|
|||
// NOTE: ar_page_id may be different from $this->mPage->getId() in some cases,
|
||||
// notably when a partially restored page has been moved, and a new page has been created
|
||||
// with the same title. Archive rows for that title will then have the wrong page id.
|
||||
$this->mPageId = isset( $row->ar_page_id )
|
||||
? intval( $row->ar_page_id )
|
||||
: $this->getArticleId( $this->mPage );
|
||||
|
||||
Assert::parameter(
|
||||
$this->mPageId > 0,
|
||||
'$row->ar_page_id',
|
||||
'must be given, or $page must be an existing page'
|
||||
);
|
||||
$this->mPageId = isset( $row->ar_page_id ) ? intval( $row->ar_page_id ) : $this->getArticleId( $this->mPage );
|
||||
|
||||
// NOTE: ar_parent_id = 0 indicates that there is no parent revision, while null
|
||||
// indicates that the parent revision is unknown. As per MW 1.31, the database schema
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ use MediaWiki\Revision\RevisionRecord;
|
|||
use MediaWiki\Revision\RevisionStore;
|
||||
use MediaWiki\User\UserFactory;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Wikimedia\Assert\Assert;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
use Wikimedia\Rdbms\ILoadBalancer;
|
||||
use Wikimedia\Rdbms\IResultWrapper;
|
||||
|
|
@ -733,8 +732,6 @@ class PageArchive {
|
|||
$pageId = $article->getId();
|
||||
}
|
||||
|
||||
Assert::invariant( $pageId > 0, 'A page ID must be known at this point (T271644)' );
|
||||
|
||||
foreach ( $result as $row ) {
|
||||
// Check for key dupes due to needed archive integrity.
|
||||
if ( $row->ar_rev_id && $allowedRevIdToArIdMap[$row->ar_rev_id] !== $row->ar_id ) {
|
||||
|
|
|
|||
|
|
@ -1436,12 +1436,6 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
|
|||
$this->mId = $newid;
|
||||
$this->mTitle->resetArticleID( $newid );
|
||||
|
||||
$name = $this->mTitle->getPrefixedDBkey();
|
||||
Assert::postcondition(
|
||||
$newid > 0,
|
||||
"Page ID for $name must be known after insert (T271644)"
|
||||
);
|
||||
|
||||
return $newid;
|
||||
} else {
|
||||
return false; // nothing changed
|
||||
|
|
|
|||
Loading…
Reference in a new issue