From 993de5fbd5dfde376f127f8e86c77c4f5972a722 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 13 Aug 2013 20:34:48 -0700 Subject: [PATCH] action=edit API with section=new would fail if page didn't exist If the page doesn't exist, $articleObject->replaceSectionContent will return null Fixes a regression introduced in be97167ab61e7d59d86f6a9dca53b7016d615735. Bug: 52830 Change-Id: Icdc0f130eeb40fff5c656c396b2a2af294015b98 --- includes/api/ApiEditPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 9c079da8f7..d14219f9e7 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -329,7 +329,7 @@ class ApiEditPage extends ApiBase { // The following is needed to give the hook the full content of the // new revision rather than just the current section. (Bug 52077) - if ( !is_null( $params['section'] ) && $contentHandler->supportsSections() ) { + if ( !is_null( $params['section'] ) && $contentHandler->supportsSections() && $titleObj->exists() ) { $sectionTitle = ''; // If sectiontitle is set, use it, otherwise use the summary as the section title (for -- 2.20.1