if ( !$rev ) {
wfDebug( __METHOD__ . " asked for bogus section (page: " .
- $this->getId() . "; section: $section; edittime: $edittime)\n" );
+ $this->getId() . "; section: $section)\n" );
wfProfileOut( __METHOD__ );
return null;
}
$logEntry->setTarget( $logTitle );
$logEntry->setComment( $reason );
$logid = $logEntry->insert();
- $logEntry->publish( $logid );
+
+ $dbw->onTransactionPreCommitOrIdle( function() use ( $dbw, $logEntry, $logid ) {
+ // Bug 56776: avoid deadlocks (especially from FileDeleteForm)
+ $logEntry->publish( $logid );
+ } );
if ( $commit ) {
$dbw->commit( __METHOD__ );