X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FEditPage.php;h=5979ed4d456a8147593bec09062a9f10adac4cc8;hb=2df7fae3950c699a06c7731323f3750334f58ae9;hp=dce8d91042c7872693624e1181d1679f1c87a806;hpb=0efd8c5acc8856bc8aa7b2ec3155d7c8946ad7dd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index dce8d91042..5979ed4d45 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -819,7 +819,7 @@ class EditPage { # If we just undid one rev, use an autosummary $firstrev = $oldrev->getNext(); - if ( $firstrev->getId() == $undo ) { + if ( $firstrev && $firstrev->getId() == $undo ) { $undoSummary = wfMsgForContent( 'undo-summary', $undo, $undorev->getUserText() ); if ( $this->summary === '' ) { $this->summary = $undoSummary; @@ -1179,9 +1179,10 @@ class EditPage { wfProfileOut( __METHOD__ . '-checks' ); - # If article is new, insert it. - $aid = $this->mTitle->getArticleID( Title::GAID_FOR_UPDATE ); - $new = ( $aid == 0 ); + // Use SELECT FOR UPDATE here to avoid transaction collision in + // WikiPage::updateRevisionOn() and ending in the self::AS_END case. + $this->mArticle->loadPageData( 'forupdate' ); + $new = !$this->mArticle->exists(); if ( $new ) { // Late check for create permission, just in case *PARANOIA* @@ -1250,10 +1251,7 @@ class EditPage { } else { # Article exists. Check for edit conflict. - - $this->mArticle->clear(); # Force reload of dates, etc. $timestamp = $this->mArticle->getTimestamp(); - wfDebug( "timestamp: {$timestamp}, edittime: {$this->edittime}\n" ); if ( $timestamp != $this->edittime ) {