Index: trunk/extensions/Review/Review.php |
— | — | @@ -322,7 +322,7 @@ |
323 | 323 | 'val_comment' => $value->val_comment , |
324 | 324 | 'val_ip' => $value->val_ip , |
325 | 325 | ) ; |
326 | | - $dbw->insert ( 'validate' , $data ) ; |
| 326 | + $dbw->replace( 'validate', array('val_user') , $data ) ; |
327 | 327 | } |
328 | 328 | $dbw->commit(); |
329 | 329 | } |
— | — | @@ -751,7 +751,7 @@ |
752 | 752 | |
753 | 753 | $out = "" ; |
754 | 754 | $skin =& $wgUser->getSkin () ; |
755 | | - $mode = $wgRequest->getText ( 'mode' , "" ) ; |
| 755 | + $mode = $wgRequest->getText ( 'mode' , 'view_page_statistics' ) ; |
756 | 756 | $page_id = $wgRequest->getInt ( 'page_id' , 0 ) ; |
757 | 757 | $rev_id = $wgRequest->getInt ( 'rev_id' , 0 ) ; |
758 | 758 | $user_id = $wgRequest->getInt ( 'user_id' , 0 ) ; |
— | — | @@ -769,7 +769,13 @@ |
770 | 770 | } |
771 | 771 | |
772 | 772 | if ( $page_id == 0 ) { |
773 | | - $title = NULL ; |
| 773 | + if( $par != null){ |
| 774 | + $title = Title::newFromUrl($par); |
| 775 | + $page_id = $title->getArticleID(); |
| 776 | + } |
| 777 | + else{ |
| 778 | + $title = NULL ; |
| 779 | + } |
774 | 780 | } else { |
775 | 781 | $title = Title::newFromID ( $page_id ) ; |
776 | 782 | } |
— | — | @@ -794,7 +800,7 @@ |
795 | 801 | |
796 | 802 | // FIXME: use private methods! |
797 | 803 | # Modes |
798 | | - if ( $mode == 'view_page_statistics' ) { |
| 804 | + if ( $mode == 'view_page_statistics' && $title != null ) { |
799 | 805 | # View statistics for one page |
800 | 806 | $revisions = $this->get_reviewed_revisions ( $title ) ; |
801 | 807 | arsort ( $revisions ) ; # Newest first |
— | — | @@ -816,7 +822,7 @@ |
817 | 823 | $out .= "</table>\n" ; |
818 | 824 | } |
819 | 825 | $page_title = wfMsgForContent ( 'review_for_page' , $title->getPrefixedText() ) ; |
820 | | - } else if ( $mode == 'view_version_statistics' ) { |
| 826 | + } else if ( $mode == 'view_version_statistics' && $title != null ) { |
821 | 827 | # View statistics for a specific version of a page |
822 | 828 | $data = array () ; |
823 | 829 | $out .= "<table id='review_statistics_table'>\n" ; |