Index: trunk/phase3/includes/Article.php |
— | — | @@ -2262,12 +2262,12 @@ |
2263 | 2263 | global $wgOut, $wgUser; |
2264 | 2264 | wfDebug( __METHOD__."\n" ); |
2265 | 2265 | |
2266 | | - $id = $this->getId(); |
| 2266 | + $id = $this->mTitle->getArticleID( GAID_FOR_UPDATE ); |
2267 | 2267 | |
2268 | 2268 | $error = ''; |
2269 | 2269 | |
2270 | | - if (wfRunHooks('ArticleDelete', array(&$this, &$wgUser, &$reason, &$error))) { |
2271 | | - if ( $this->doDeleteArticle( $reason, $suppress ) ) { |
| 2270 | + if ( wfRunHooks('ArticleDelete', array(&$this, &$wgUser, &$reason, &$error)) ) { |
| 2271 | + if ( $this->doDeleteArticle( $reason, $suppress, $id ) ) { |
2272 | 2272 | $deleted = $this->mTitle->getPrefixedText(); |
2273 | 2273 | |
2274 | 2274 | $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) ); |
— | — | @@ -2292,7 +2292,7 @@ |
2293 | 2293 | * Deletes the article with database consistency, writes logs, purges caches |
2294 | 2294 | * Returns success |
2295 | 2295 | */ |
2296 | | - function doDeleteArticle( $reason, $suppress = false ) { |
| 2296 | + function doDeleteArticle( $reason, $suppress = false, $id = 0 ) { |
2297 | 2297 | global $wgUseSquid, $wgDeferredUpdateList; |
2298 | 2298 | global $wgUseTrackbacks; |
2299 | 2299 | |
— | — | @@ -2301,7 +2301,7 @@ |
2302 | 2302 | $dbw = wfGetDB( DB_MASTER ); |
2303 | 2303 | $ns = $this->mTitle->getNamespace(); |
2304 | 2304 | $t = $this->mTitle->getDBkey(); |
2305 | | - $id = $this->mTitle->getArticleID(); |
| 2305 | + $id = $id ? $id : $this->mTitle->getArticleID( GAID_FOR_UPDATE ); |
2306 | 2306 | |
2307 | 2307 | if ( $t == '' || $id == 0 ) { |
2308 | 2308 | return false; |
Index: trunk/phase3/includes/FileDeleteForm.php |
— | — | @@ -105,11 +105,12 @@ |
106 | 106 | } else { |
107 | 107 | $status = $file->delete( $reason, $suppress ); |
108 | 108 | if( $status->ok ) { |
| 109 | + $id = $title->getArticleID( GAID_FOR_UPDATE ); |
109 | 110 | // Need to delete the associated article |
110 | 111 | $article = new Article( $title ); |
111 | 112 | if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)) ) { |
112 | | - if( $article->doDeleteArticle( $reason, $suppress ) ) |
113 | | - wfRunHooks('ArticleDeleteComplete', array(&$article, &$wgUser, $reason)); |
| 113 | + if( $article->doDeleteArticle( $reason, $suppress, $id ) ) |
| 114 | + wfRunHooks('ArticleDeleteComplete', array(&$article, &$wgUser, $reason, $id)); |
114 | 115 | } |
115 | 116 | } |
116 | 117 | } |