jenkins-bot has submitted this change and it was merged.

Change subject: action=edit API with section=new would fail if page didn't exist
......................................................................


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
---
M includes/api/ApiEditPage.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Hoo man: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php
index 9c079da..d14219f 100644
--- a/includes/api/ApiEditPage.php
+++ b/includes/api/ApiEditPage.php
@@ -329,7 +329,7 @@
 
                // 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

-- 
To view, visit https://gerrit.wikimedia.org/r/79031
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icdc0f130eeb40fff5c656c396b2a2af294015b98
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MZMcBride <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to