r45159 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45158‎ | r45159 | r45160 >
Date:18:49, 29 December 2008
Author:aaron
Status:ok (Comments)
Tags:
Comment:
* (bug 16209) Deleted images are not watched
* Add watchlist check to filedelete form
* Fix XHTML on filedelete form
Modified paths:
  • /trunk/phase3/includes/FileDeleteForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/FileDeleteForm.php
@@ -109,8 +109,15 @@
110110 // Need to delete the associated article
111111 $article = new Article( $title );
112112 if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)) ) {
113 - if( $article->doDeleteArticle( $reason, $suppress, $id ) )
 113+ if( $article->doDeleteArticle( $reason, $suppress, $id ) ) {
 114+ global $wgRequest;
 115+ if( $wgRequest->getCheck( 'wpWatch' ) ) {
 116+ $article->doWatch();
 117+ } elseif( $this->mTitle->userIsWatching() ) {
 118+ $article->doUnwatch();
 119+ }
114120 wfRunHooks('ArticleDeleteComplete', array(&$article, &$wgUser, $reason, $id));
 121+ }
115122 }
116123 }
117124 }
@@ -127,7 +134,7 @@
128135 global $wgOut, $wgUser, $wgRequest;
129136
130137 if( $wgUser->isAllowed( 'suppressrevision' ) ) {
131 - $suppress = "<tr id=\"wpDeleteSuppressRow\" name=\"wpDeleteSuppressRow\">
 138+ $suppress = "<tr id=\"wpDeleteSuppressRow\">
132139 <td></td>
133140 <td class='mw-input'>" .
134141 Xml::checkLabel( wfMsg( 'revdelete-suppress' ),
@@ -138,7 +145,9 @@
139146 $suppress = '';
140147 }
141148
142 - $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction(), 'id' => 'mw-img-deleteconfirm' ) ) .
 149+ $checkWatch = $wgUser->getBoolOption( 'watchdeletion' ) || $this->title->userIsWatching();
 150+ $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction(),
 151+ 'id' => 'mw-img-deleteconfirm' ) ) .
143152 Xml::openElement( 'fieldset' ) .
144153 Xml::element( 'legend', null, wfMsg( 'filedelete-legend' ) ) .
145154 Xml::hidden( 'wpEditToken', $wgUser->editToken( $this->oldimage ) ) .
@@ -166,6 +175,13 @@
167176 {$suppress}
168177 <tr>
169178 <td></td>
 179+ <td class='mw-input'>" .
 180+ Xml::checkLabel( wfMsg( 'watchthis' ),
 181+ 'wpWatch', 'wpWatch', $checkWatch, array( 'tabindex' => '3' ) ) .
 182+ "</td>
 183+ </tr>
 184+ <tr>
 185+ <td></td>
170186 <td class='mw-submit'>" .
171187 Xml::submitButton( wfMsg( 'filedelete-submit' ),
172188 array( 'name' => 'mw-filedelete-submit', 'id' => 'mw-filedelete-submit', 'tabindex' => '4' ) ) .

Follow-up revisions

RevisionCommit summaryAuthorDate
r45278Fix PHP fatal error in /usr/local/apache/common-local/php-1.5/includes/FileD...raymond13:15, 1 January 2009

Comments

#Comment by Raymond (talk | contribs)   13:21, 1 January 2009

A regression with a fatal error fixed with r45278 PHP fatal error in /usr/local/apache/common-local/php-1.5/includes/FileDeleteForm.php line 116:

Status & tagging log