API: Fix setting of wpIgnoreBlankSummary in action=edit
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 20 Jan 2015 21:15:36 +0000 (13:15 -0800)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 20 Jan 2015 21:15:36 +0000 (13:15 -0800)
EditPage checks this using getBool(), not getCheck(), so empty string is
interpreted as false.

Also clean up a long-obsolete comment.

Bug: T87188
Change-Id: I18f376cefad44295874d7b1cd760ba6fc966be29

includes/api/ApiEditPage.php

index f663cc6..8ad2ad9 100644 (file)
@@ -252,7 +252,7 @@ class ApiEditPage extends ApiBase {
                        'format' => $contentFormat,
                        'model' => $contentHandler->getModelID(),
                        'wpEditToken' => $params['token'],
-                       'wpIgnoreBlankSummary' => '',
+                       'wpIgnoreBlankSummary' => true,
                        'wpIgnoreBlankArticle' => true,
                        'wpIgnoreSelfRedirect' => true,
                );
@@ -462,7 +462,6 @@ class ApiEditPage extends ApiBase {
                        case EditPage::AS_CONFLICT_DETECTED:
                                $this->dieUsageMsg( 'editconflict' );
 
-                       // case EditPage::AS_SUMMARY_NEEDED: Can't happen since we set wpIgnoreBlankSummary
                        case EditPage::AS_TEXTBOX_EMPTY:
                                $this->dieUsageMsg( 'emptynewsection' );
 
@@ -487,6 +486,7 @@ class ApiEditPage extends ApiBase {
                                break;
 
                        case EditPage::AS_SUMMARY_NEEDED:
+                               // Shouldn't happen since we set wpIgnoreBlankSummary, but just in case
                                $this->dieUsageMsg( 'summaryrequired' );
 
                        case EditPage::AS_END: