r25389 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25388‎ | r25389 | r25390 >
Date:15:08, 1 September 2007
Author:catrope
Status:old
Tags:
Comment:
apiedit: Adding missingtitle error messages to ApiProtect, ApiDelete and ApiUndelete
Modified paths:
  • /branches/apiedit/phase3/CHANGED (modified) (history)
  • /branches/apiedit/phase3/includes/api/ApiDelete.php (modified) (history)
  • /branches/apiedit/phase3/includes/api/ApiProtect.php (modified) (history)
  • /branches/apiedit/phase3/includes/api/ApiUndelete.php (modified) (history)

Diff [purge]

Index: branches/apiedit/phase3/CHANGED
@@ -27,15 +27,18 @@
2828
2929 api/ApiDelete.php (NEW)
3030 * action=delete module that wraps around Article::doDeleteArticle() (r23590)
 31+* Added missingtitle error message (r25389)
3132
3233 api/ApiQueryDeletedRevs.php (NEW)
3334 * action=query&list=deletedrevs module that lists deleted revisions from the archive table (r23668)
3435
3536 api/ApiUndelete.php (NEW)
3637 * action=undelete module that wraps around PageArchive::undelete() (r23687, r23697)
 38+* Added missingtitle error message (r25389)
3739
3840 api/ApiProtect.php (NEW)
3941 * action=protect module that wraps around Article::updateRestrictions() (r25388)
 42+* Added missingtitle error message (r25389)
4043
4144 AutoLoader.php
4245 * Added entries for ApiRollback (r23562), ApiDelete (r23590), ApiQueryDeletedRevs (r23668), ApiUndelete (r23687), ApiProtect (r23588)
Index: branches/apiedit/phase3/includes/api/ApiProtect.php
@@ -61,7 +61,7 @@
6262 if(!$titleObj)
6363 $this->dieUsage("bad title {$params['title']}", 'invalidtitle');
6464 if(!$titleObj->exists())
65 - $this->dieUsage("{$params['title']} doesn't exist", "nonexistenttitle");
 65+ $this->dieUsage("{$params['title']} doesn't exist", 'missingtitle');
6666 $articleObj = new Article($titleObj);
6767
6868 if(in_array($params['expiry'], array('infinite', 'indefinite', 'never')))
Index: branches/apiedit/phase3/includes/api/ApiDelete.php
@@ -103,6 +103,8 @@
104104 $titleObj = Title::newFromText($params['title']);
105105 if(!$titleObj)
106106 $this->dieUsage("bad title {$params['title']}", 'invalidtitle');
 107+ if(!$titleObj->exists())
 108+ $this->dieUsage("{$params['title']} doesn't exist", 'missingtitle');
107109
108110 $articleObj = new Article($titleObj);
109111 $reason = (isset($params['reason']) ? $params['reason'] : NULL);
Index: branches/apiedit/phase3/includes/api/ApiUndelete.php
@@ -58,6 +58,8 @@
5959 $titleObj = Title::newFromText($params['title']);
6060 if(!$titleObj)
6161 $this->dieUsage("bad title {$params['title']}", 'invalidtitle');
 62+ if(!$titleObj->exists())
 63+ $this->dieUsage("{$params['title']} doesn't exist", 'missingtitle');
6264 $pa = new PageArchive($titleObj);
6365 $retval = $pa->undelete((isset($params['timestamps']) ? $params['timestamps'] : array()), $params['reason']);
6466 if(!is_array($retval))

Status & tagging log