r106568 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106567‎ | r106568 | r106569 >
Date:16:02, 18 December 2011
Author:ialex
Status:ok
Tags:
Comment:
And I of course forgot to commit ProtectionForm.php in r106567...
Modified paths:
  • /trunk/phase3/includes/ProtectionForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ProtectionForm.php
@@ -247,7 +247,7 @@
248248 * @return Boolean: success
249249 */
250250 function save() {
251 - global $wgRequest, $wgUser;
 251+ global $wgRequest, $wgUser, $wgOut;
252252
253253 # Permission check!
254254 if ( $this->disabled ) {
@@ -294,14 +294,11 @@
295295 !(isset($wgGroupPermissions[$edit_restriction]['protect']) && $wgGroupPermissions[$edit_restriction]['protect'] ) )
296296 $this->mCascade = false;
297297
298 - if ($this->mTitle->exists()) {
299 - $ok = $this->mArticle->updateRestrictions( $this->mRestrictions, $reasonstr, $this->mCascade, $expiry );
300 - } else {
301 - $ok = $this->mTitle->updateTitleProtection( $this->mRestrictions['create'], $reasonstr, $expiry['create'] );
302 - }
 298+ $status = $this->mArticle->doUpdateRestrictions( $this->mRestrictions, $expiry, $this->mCascade, $reasonstr, $wgUser );
303299
304 - if( !$ok ) {
305 - throw new FatalError( "Unknown error at restriction save time." );
 300+ if ( !$status->isOK() ) {
 301+ $this->show( $wgOut->parseInline( $status->getWikiText() ) );
 302+ return false;
306303 }
307304
308305 /**
@@ -326,7 +323,7 @@
327324 } elseif ( $this->mTitle->userIsWatching() ) {
328325 WatchAction::doUnwatch( $this->mTitle, $wgUser );
329326 }
330 - return $ok;
 327+ return true;
331328 }
332329
333330 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106567* Merged WikiPage::updateRestrictions() and Title::updateTitleProtection() in...ialex16:01, 18 December 2011

Status & tagging log