From: Kunal Mehta Date: Wed, 14 Aug 2013 03:34:48 +0000 (-0700) Subject: action=edit API with section=new would fail if page didn't exist X-Git-Tag: 1.31.0-rc.0~18918^2~1 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=993de5fbd5dfde376f127f8e86c77c4f5972a722;p=lhc%2Fweb%2Fwiklou.git 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 --- 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