From 24f04d9f77b6a74f753f000a8bdd6b0e8d04c84a Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 20 Jan 2015 13:15:36 -0800 Subject: [PATCH] API: Fix setting of wpIgnoreBlankSummary in action=edit 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index f663cc6559..8ad2ad9383 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -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: -- 2.20.1