// Now that it's safely backed up, delete it
$dbw->delete( 'page', [ 'page_id' => $id ], __METHOD__ );
-
- if ( !$dbw->cascadingDeletes() ) {
- $dbw->delete( 'revision', [ 'rev_page' => $id ], __METHOD__ );
- }
+ $dbw->delete( 'revision', [ 'rev_page' => $id ], __METHOD__ );
// Log the deletion, if the page was suppressed, put it in the suppression log instead
$logtype = $suppress ? 'suppress' : 'delete';
$logEntry->setComment( $reason );
$logid = $logEntry->insert();
- $dbw->onTransactionPreCommitOrIdle( function () use ( $dbw, $logEntry, $logid ) {
- // Bug 56776: avoid deadlocks (especially from FileDeleteForm)
- $logEntry->publish( $logid );
- } );
+ $dbw->onTransactionPreCommitOrIdle(
+ function () use ( $dbw, $logEntry, $logid ) {
+ // Bug 56776: avoid deadlocks (especially from FileDeleteForm)
+ $logEntry->publish( $logid );
+ },
+ __METHOD__
+ );
$dbw->endAtomic( __METHOD__ );
$cat->refreshCounts();
}
}
- }
+ },
+ __METHOD__
);
}
*
* @param Content|null $content Optional Content object for determining the
* necessary updates.
- * @return DataUpdate[]
+ * @return DeferrableUpdate[]
*/
public function getDeletionUpdates( Content $content = null ) {
if ( !$content ) {