r26230 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26229‎ | r26230 | r26231 >
Date:23:32, 28 September 2007
Author:aaron
Status:old
Tags:
Comment:
*Log even if settings defaults for consistency and tracking if site defaults change.
*More fixes, cleanup.
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -1108,6 +1108,7 @@
11091109 array( 'rc_this_oldid' => $rev->getID() ),
11101110 __METHOD__ );
11111111 }
 1112+ return true;
11121113 }
11131114
11141115 /**
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php
@@ -971,23 +971,22 @@
972972
973973 function submit() {
974974 global $wgOut, $wgFlaggedRevs, $wgUser, $wgParser;
975 - # Get current config
976 - $config = $wgFlaggedRevs->getVisibilitySettings( $this->page, true );
977975
978 - $comment = $this->comment;
979 -
980976 $dbw = wfGetDB( DB_MASTER );
 977+ # Get current config
 978+ $row = $dbw->selectRow( 'flaggedpages',
 979+ array( 'fp_select', 'fp_override' ),
 980+ array( 'fp_page_id' => $this->page->getArticleID() ),
 981+ __METHOD__ );
 982+ # Fire away!
981983 $success = $dbw->replace( 'flaggedpages',
982984 array( 'fp_page_id' ),
983985 array( 'fp_page_id' => $this->page->getArticleID(),
984986 'fp_select' => $this->select,
985987 'fp_override' => $this->override ),
986988 __METHOD__ );
987 -
988 - $wgOut->addHTML( wfMsgExt('stabilization-success',array('parse'),
989 - $this->page->getPrefixedText() ) );
990 - # Log if changed
991 - if( $config['select'] != $this->select || $config['override'] != $this->override ) {
 989+ # Log if changed
 990+ if( !$row || $row->fp_select != $this->select || $row->fp_override != $this->override ) {
992991 $log = new LogPage( 'review' );
993992 // ID, accuracy, depth, style
994993 $set = array();
@@ -999,7 +998,7 @@
1000999 $settings = ' [' . implode(', ',$set). ']';
10011000 // Append comment with action
10021001 // FIXME: do this better
1003 - $comment = ($comment) ? "$comment$settings" : "$settings";
 1002+ $comment = ($this->comment) ? "{$this->comment}$settings" : "$settings";
10041003
10051004 $log->addEntry( 'config', $this->page, $comment );
10061005 }
@@ -1016,5 +1015,9 @@
10171016 }
10181017 $u = new LinksUpdate( $article->mTitle, $poutput );
10191018 $u->doUpdate(); // this will trigger our hook to add stable links too...
 1019+
 1020+ # Success message
 1021+ $wgOut->addHTML( wfMsgExt('stabilization-success',array('parse'),
 1022+ $this->page->getPrefixedText() ) );
10201023 }
10211024 }
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php
@@ -67,7 +67,7 @@
6868 for content pages.',
6969 'review-logentry-app' => 'reviewed $1',
7070 'review-logentry-dis' => 'depreciated a version of $1',
71 - 'review-logentry-conf' => 'set stable version settings for $1',
 71+ 'review-logentry-conf' => 'configured stable versioning for $1',
7272 'review-logaction' => 'revision ID $1',
7373
7474 'revisionreview' => 'Review revisions',

Status & tagging log