Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -919,6 +919,7 @@ |
920 | 920 | |
921 | 921 | 'RevisionInsertComplete': called after a revision is inserted into the DB |
922 | 922 | $revision: the Revision |
| 923 | +$edit: was this a new edit? |
923 | 924 | |
924 | 925 | 'SavePreferences': called at the end of PreferencesForm::savePreferences; |
925 | 926 | returning false prevents the preferences from being saved. |
Index: trunk/phase3/includes/SpecialImport.php |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | $dbw = wfGetDB( DB_MASTER ); |
220 | 220 | $nullRevision = Revision::newNullRevision( |
221 | 221 | $dbw, $title->getArticleId(), $comment, true ); |
222 | | - $nullRevision->insertOn( $dbw ); |
| 222 | + $nullRevision->insertOn( $dbw, true ); |
223 | 223 | # Update page record |
224 | 224 | $article = new Article( $title ); |
225 | 225 | $article->updateRevisionOn( $dbw, $nullRevision ); |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -1444,7 +1444,7 @@ |
1445 | 1445 | ) ); |
1446 | 1446 | |
1447 | 1447 | $dbw->begin(); |
1448 | | - $revisionId = $revision->insertOn( $dbw ); |
| 1448 | + $revisionId = $revision->insertOn( $dbw, true ); |
1449 | 1449 | |
1450 | 1450 | # Update page |
1451 | 1451 | $ok = $this->updateRevisionOn( $dbw, $revision, $lastRevision ); |
— | — | @@ -1512,7 +1512,7 @@ |
1513 | 1513 | 'minor_edit' => $isminor, |
1514 | 1514 | 'text' => $text |
1515 | 1515 | ) ); |
1516 | | - $revisionId = $revision->insertOn( $dbw ); |
| 1516 | + $revisionId = $revision->insertOn( $dbw, true ); |
1517 | 1517 | |
1518 | 1518 | $this->mTitle->resetArticleID( $newid ); |
1519 | 1519 | |
Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -862,7 +862,7 @@ |
863 | 863 | if( $descTitle->exists() ) { |
864 | 864 | # Create a null revision |
865 | 865 | $nullRevision = Revision::newNullRevision( $dbw, $descTitle->getArticleId(), $log->getRcComment(), false ); |
866 | | - $nullRevision->insertOn( $dbw ); |
| 866 | + $nullRevision->insertOn( $dbw, true ); |
867 | 867 | $article->updateRevisionOn( $dbw, $nullRevision ); |
868 | 868 | |
869 | 869 | # Invalidate the cache for the description page |
Index: trunk/phase3/includes/filerepo/ICRepo.php |
— | — | @@ -285,7 +285,7 @@ |
286 | 286 | if( $descTitle->exists() ) { |
287 | 287 | # Create a null revision |
288 | 288 | $nullRevision = Revision::newNullRevision( $dbw, $descTitle->getArticleId(), $log->getRcComment(), false ); |
289 | | - $nullRevision->insertOn( $dbw ); |
| 289 | + $nullRevision->insertOn( $dbw, true ); |
290 | 290 | $article->updateRevisionOn( $dbw, $nullRevision ); |
291 | 291 | |
292 | 292 | # Invalidate the cache for the description page |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -707,9 +707,10 @@ |
708 | 708 | * number on success and dies horribly on failure. |
709 | 709 | * |
710 | 710 | * @param Database $dbw |
| 711 | + * @param bool $edit, was this a new edit? (optional) |
711 | 712 | * @return int |
712 | 713 | */ |
713 | | - public function insertOn( &$dbw ) { |
| 714 | + public function insertOn( &$dbw, $edit=false ) { |
714 | 715 | global $wgDefaultExternalStore; |
715 | 716 | |
716 | 717 | wfProfileIn( __METHOD__ ); |
— | — | @@ -772,7 +773,7 @@ |
773 | 774 | |
774 | 775 | $this->mId = !is_null($rev_id) ? $rev_id : $dbw->insertId(); |
775 | 776 | |
776 | | - wfRunHooks( 'RevisionInsertComplete', array( &$this ) ); |
| 777 | + wfRunHooks( 'RevisionInsertComplete', array( &$this, $edit ) ); |
777 | 778 | |
778 | 779 | wfProfileOut( __METHOD__ ); |
779 | 780 | return $this->mId; |
Index: trunk/phase3/includes/SpecialUndelete.php |
— | — | @@ -514,7 +514,7 @@ |
515 | 515 | 'deleted' => $unsuppress ? 0 : $row->ar_deleted, |
516 | 516 | 'len' => $row->ar_len |
517 | 517 | ) ); |
518 | | - $revision->insertOn( $dbw ); |
| 518 | + $revision->insertOn( $dbw, false ); |
519 | 519 | $restored++; |
520 | 520 | |
521 | 521 | wfRunHooks( 'ArticleRevisionUndeleted', array( &$this->title, $revision, $row->ar_page_id ) ); |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2596,7 +2596,7 @@ |
2597 | 2597 | |
2598 | 2598 | # Save a null revision in the page's history notifying of the move |
2599 | 2599 | $nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true ); |
2600 | | - $nullRevId = $nullRevision->insertOn( $dbw ); |
| 2600 | + $nullRevId = $nullRevision->insertOn( $dbw, true ); |
2601 | 2601 | |
2602 | 2602 | # Change the name of the target page: |
2603 | 2603 | $dbw->update( 'page', |
— | — | @@ -2622,7 +2622,7 @@ |
2623 | 2623 | 'page' => $newid, |
2624 | 2624 | 'comment' => $comment, |
2625 | 2625 | 'text' => $redirectText ) ); |
2626 | | - $redirectRevision->insertOn( $dbw ); |
| 2626 | + $redirectRevision->insertOn( $dbw, true ); |
2627 | 2627 | $redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 ); |
2628 | 2628 | |
2629 | 2629 | # Now, we record the link from the redirect to the new title. |
— | — | @@ -2683,7 +2683,7 @@ |
2684 | 2684 | |
2685 | 2685 | # Save a null revision in the page's history notifying of the move |
2686 | 2686 | $nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true ); |
2687 | | - $nullRevId = $nullRevision->insertOn( $dbw ); |
| 2687 | + $nullRevId = $nullRevision->insertOn( $dbw, true ); |
2688 | 2688 | |
2689 | 2689 | # Rename page entry |
2690 | 2690 | $dbw->update( 'page', |
— | — | @@ -2709,7 +2709,7 @@ |
2710 | 2710 | 'page' => $newid, |
2711 | 2711 | 'comment' => $comment, |
2712 | 2712 | 'text' => $redirectText ) ); |
2713 | | - $redirectRevision->insertOn( $dbw ); |
| 2713 | + $redirectRevision->insertOn( $dbw, true ); |
2714 | 2714 | $redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 ); |
2715 | 2715 | |
2716 | 2716 | # Record the just-created redirect's linking to the page |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -1910,11 +1910,6 @@ |
1911 | 1911 | if( !$wgRequest->wasPosted() ) { |
1912 | 1912 | return false; |
1913 | 1913 | } |
1914 | | - # Sent to page title or Special:MovePage |
1915 | | - $move = SpecialPage::getTitleFor( 'MovePage' ); |
1916 | | - if( !in_array( $wgRequest->getVal('title'), array($title->getPrefixedDBkey(),$move->getPrefixedDBkey()) ) ) { |
1917 | | - return false; |
1918 | | - } |
1919 | 1914 | # Must be by this user |
1920 | 1915 | if( $wgUser->getId() ) { |
1921 | 1916 | if( $rev->getUser() != $wgUser->getId() ) { |
— | — | @@ -1933,7 +1928,7 @@ |
1934 | 1929 | * When an edit is made by a reviewer, if the current revision is the stable |
1935 | 1930 | * version, try to automatically review it. |
1936 | 1931 | */ |
1937 | | - public static function maybeMakeEditReviewed( $rev ) { |
| 1932 | + public static function maybeMakeEditReviewed( $rev, $edit ) { |
1938 | 1933 | global $wgFlaggedRevsAutoReview, $wgFlaggedArticle, $wgRequest; |
1939 | 1934 | # Get the user |
1940 | 1935 | $user = User::newFromId( $rev->getUser() ); |