Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -991,11 +991,12 @@ |
992 | 992 | $log->getRcComment(), |
993 | 993 | false |
994 | 994 | ); |
995 | | - $nullRevision->insertOn( $dbw ); |
| 995 | + if (!is_null($nullRevision)) { |
| 996 | + $nullRevision->insertOn( $dbw ); |
996 | 997 | |
997 | | - wfRunHooks( 'NewRevisionFromEditComplete', array( $article, $nullRevision, $latest, $user ) ); |
998 | | - $article->updateRevisionOn( $dbw, $nullRevision ); |
999 | | - |
| 998 | + wfRunHooks( 'NewRevisionFromEditComplete', array( $article, $nullRevision, $latest, $user ) ); |
| 999 | + $article->updateRevisionOn( $dbw, $nullRevision ); |
| 1000 | + } |
1000 | 1001 | # Invalidate the cache for the description page |
1001 | 1002 | $descTitle->invalidateCache(); |
1002 | 1003 | $descTitle->purgeSquid(); |
Index: trunk/phase3/includes/specials/SpecialImport.php |
— | — | @@ -384,11 +384,13 @@ |
385 | 385 | $dbw = wfGetDB( DB_MASTER ); |
386 | 386 | $latest = $title->getLatestRevID(); |
387 | 387 | $nullRevision = Revision::newNullRevision( $dbw, $title->getArticleId(), $comment, true ); |
388 | | - $nullRevision->insertOn( $dbw ); |
389 | | - $article = new Article( $title ); |
390 | | - # Update page record |
391 | | - $article->updateRevisionOn( $dbw, $nullRevision ); |
392 | | - wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, $latest, $wgUser) ); |
| 388 | + if (!is_null($nullRevision)) { |
| 389 | + $nullRevision->insertOn( $dbw ); |
| 390 | + $article = new Article( $title ); |
| 391 | + # Update page record |
| 392 | + $article->updateRevisionOn( $dbw, $nullRevision ); |
| 393 | + wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, $latest, $wgUser) ); |
| 394 | + } |
393 | 395 | } else { |
394 | 396 | $wgOut->addHTML( "<li>" . Linker::linkKnown( $title ) . " " . |
395 | 397 | wfMsgHtml( 'import-nonewrevisions' ) . "</li>\n" ); |