Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -650,6 +650,7 @@ |
651 | 651 | 'cannotundelete' => array('code' => 'cantundelete', 'info' => "Couldn't undelete: the requested revisions may not exist, or may have been undeleted already"), |
652 | 652 | 'permdenied-undelete' => array('code' => 'permissiondenied', 'info' => "You don't have permission to restore deleted revisions"), |
653 | 653 | 'createonly-exists' => array('code' => 'articleexists', 'info' => "The article you tried to create has been created already"), |
| 654 | + 'nocreate-missing' => array('code' => 'missingtitle', 'info' => "The article you tried to edit doesn't exist"), |
654 | 655 | |
655 | 656 | // ApiEditPage messages |
656 | 657 | 'noimageredirect-anon' => array('code' => 'noimageredirect-anon', 'info' => "Anonymous users can't create image redirects"), |
Index: trunk/phase3/includes/api/ApiEditPage.php |
— | — | @@ -59,6 +59,8 @@ |
60 | 60 | |
61 | 61 | if($params['createonly'] && $titleObj->exists()) |
62 | 62 | $this->dieUsageMsg(array('createonly-exists')); |
| 63 | + if($params['nocreate'] && !$titleObj->exists()) |
| 64 | + $this->dieUsageMsg(array('nocreate-missing')); |
63 | 65 | |
64 | 66 | // Now let's check whether we're even allowed to do this |
65 | 67 | $errors = $titleObj->getUserPermissionsErrors('edit', $wgUser); |
— | — | @@ -245,6 +247,7 @@ |
246 | 248 | 'basetimestamp' => null, |
247 | 249 | 'recreate' => false, |
248 | 250 | 'createonly' => false, |
| 251 | + 'nocreate' => false, |
249 | 252 | 'captchaword' => null, |
250 | 253 | 'captchaid' => null, |
251 | 254 | 'watch' => false, |
— | — | @@ -269,7 +272,8 @@ |
270 | 273 | 'Used to detect edit conflicts; leave unset to ignore conflicts.' |
271 | 274 | ), |
272 | 275 | 'recreate' => 'Override any errors about the article having been deleted in the meantime', |
273 | | - 'createonly' => 'Don\'t create the page if it exists already', |
| 276 | + 'createonly' => 'Don\'t edit the page if it exists already', |
| 277 | + 'nocreate' => 'Throw an error if the page doesn\'t exist', |
274 | 278 | 'watch' => 'Add the page to your watchlist', |
275 | 279 | 'unwatch' => 'Remove the page from your watchlist', |
276 | 280 | 'captchaid' => 'CAPTCHA ID from previous request', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -447,6 +447,7 @@ |
448 | 448 | * (bug 14459) Added prependtext and appendtext parameters to action=edit |
449 | 449 | * (bug 14526) Unescaped SQL in list=backlinks |
450 | 450 | * Added 'hidden' flag to list=allcategories and prop=categoryinfo output |
| 451 | +* Added nocreate parameter to action=edit |
451 | 452 | |
452 | 453 | === Languages updated in 1.13 === |
453 | 454 | |