Index: trunk/phase3/includes/Title.php |
— | — | @@ -2602,6 +2602,7 @@ |
2603 | 2603 | $now = wfTimestampNow(); |
2604 | 2604 | $newid = $nt->getArticleID(); |
2605 | 2605 | $oldid = $this->getArticleID(); |
| 2606 | + $latest = $this->getLatestRevID(); |
2606 | 2607 | |
2607 | 2608 | $dbw = wfGetDB( DB_MASTER ); |
2608 | 2609 | $dbw->begin(); |
— | — | @@ -2630,7 +2631,7 @@ |
2631 | 2632 | $nullRevId = $nullRevision->insertOn( $dbw ); |
2632 | 2633 | |
2633 | 2634 | $article = new Article( $this ); |
2634 | | - wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, false) ); |
| 2635 | + wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, $latest) ); |
2635 | 2636 | |
2636 | 2637 | # Change the name of the target page: |
2637 | 2638 | $dbw->update( 'page', |
— | — | @@ -2716,6 +2717,7 @@ |
2717 | 2718 | |
2718 | 2719 | $newid = $nt->getArticleID(); |
2719 | 2720 | $oldid = $this->getArticleID(); |
| 2721 | + $latest = $this->getLatestRevId(); |
2720 | 2722 | |
2721 | 2723 | $dbw = wfGetDB( DB_MASTER ); |
2722 | 2724 | $dbw->begin(); |
— | — | @@ -2726,7 +2728,7 @@ |
2727 | 2729 | $nullRevId = $nullRevision->insertOn( $dbw ); |
2728 | 2730 | |
2729 | 2731 | $article = new Article( $this ); |
2730 | | - wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, false) ); |
| 2732 | + wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, $latest) ); |
2731 | 2733 | |
2732 | 2734 | # Rename page entry |
2733 | 2735 | $dbw->update( 'page', |
— | — | @@ -2941,16 +2943,16 @@ |
2942 | 2944 | /** |
2943 | 2945 | * Get the revision ID of the previous revision |
2944 | 2946 | * |
2945 | | - * @param integer $revision Revision ID. Get the revision that was before this one. |
| 2947 | + * @param integer $revId Revision ID. Get the revision that was before this one. |
2946 | 2948 | * @param integer $flags, GAID_FOR_UPDATE |
2947 | 2949 | * @return integer $oldrevision|false |
2948 | 2950 | */ |
2949 | | - public function getPreviousRevisionID( $revision, $flags=0 ) { |
| 2951 | + public function getPreviousRevisionID( $revId, $flags=0 ) { |
2950 | 2952 | $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
2951 | 2953 | return $db->selectField( 'revision', 'rev_id', |
2952 | 2954 | array( |
2953 | 2955 | 'rev_page' => $this->getArticleId($flags), |
2954 | | - 'rev_id < ' . intval( $revision ) |
| 2956 | + 'rev_id < ' . intval( $revId ) |
2955 | 2957 | ), |
2956 | 2958 | __METHOD__, |
2957 | 2959 | array( 'ORDER BY' => 'rev_id DESC' ) |
— | — | @@ -2960,16 +2962,16 @@ |
2961 | 2963 | /** |
2962 | 2964 | * Get the revision ID of the next revision |
2963 | 2965 | * |
2964 | | - * @param integer $revision Revision ID. Get the revision that was after this one. |
| 2966 | + * @param integer $revId Revision ID. Get the revision that was after this one. |
2965 | 2967 | * @param integer $flags, GAID_FOR_UPDATE |
2966 | 2968 | * @return integer $oldrevision|false |
2967 | 2969 | */ |
2968 | | - public function getNextRevisionID( $revision, $flags=0 ) { |
| 2970 | + public function getNextRevisionID( $revId, $flags=0 ) { |
2969 | 2971 | $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
2970 | 2972 | return $db->selectField( 'revision', 'rev_id', |
2971 | 2973 | array( |
2972 | 2974 | 'rev_page' => $this->getArticleId($flags), |
2973 | | - 'rev_id > ' . intval( $revision ) |
| 2975 | + 'rev_id > ' . intval( $revId ) |
2974 | 2976 | ), |
2975 | 2977 | __METHOD__, |
2976 | 2978 | array( 'ORDER BY' => 'rev_id' ) |