r32742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32741‎ | r32742 | r32743 >
Date:15:09, 3 April 2008
Author:rainman
Status:old
Tags:
Comment:
Suboptimal solution for one of the issues behind bug 12049 (i.e. that
don't get deleted from search index) :
* hooks ArticleDelete[Complete] are now called from FileDeleteForm as well,
this seems to be the expected behavior by most extensions (OAI, TitleKey,
Rsync, ...).
* delete via API however still misses these hooks

Other possible solutions:
* move hooks into backend - bad since we want a clean backend
* create FileDelete hook (per bug 11276) - seems to me as unnecessary
duplication of code logic since article might or might not be
deleted during file deletion
* make a new Article function and wrap calls - will pollute clean Article
doDelete and doDeleteArticle calls
Modified paths:
  • /trunk/phase3/includes/FileDeleteForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/FileDeleteForm.php
@@ -91,8 +91,11 @@
9292 $status = $this->file->delete( $reason, $suppress );
9393 if( $status->ok ) {
9494 // Need to delete the associated article
95 - $article = new Article( $this->title );
96 - $article->doDeleteArticle( $reason, $suppress );
 95+ $article = new Article( $this->title );
 96+ if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)) ){
 97+ if( $article->doDeleteArticle( $reason, $suppress ) )
 98+ wfRunHooks('ArticleDeleteComplete', array(&$article, &$wgUser, $reason));
 99+ }
97100 }
98101 }
99102 if( $status->isGood() ) wfRunHooks('FileDeleteComplete', array(

Status & tagging log