From 504426ec66bea3ca7c2a2ea26da03e813a37e8c0 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 26 Feb 2008 22:40:59 +0000 Subject: [PATCH] (bug 13100) Added 'preloadtitle' parameter to action=edit§ion=new that pre-fills the section title field. Patch by Mike Dillon --- RELEASE-NOTES | 2 ++ includes/EditPage.php | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cf5b642aa5..d7f6c99358 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -34,6 +34,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN confused when they are told they are range-blocked. * Add a new hook ImageBeforeProduceHTML to allow extensions to modify wikitext image syntax output. +* (bug 13100) Added 'preloadtitle' parameter to action=edit§ion=new that + pre-fills the section title field. === Bug fixes in 1.13 === diff --git a/includes/EditPage.php b/includes/EditPage.php index 1a3eae72e3..badb695df1 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -531,6 +531,9 @@ class EditPage { $fname = 'EditPage::importFormData'; wfProfileIn( $fname ); + # Section edit can come from either the form or a link + $this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) ); + if( $request->wasPosted() ) { # These fields need to be checked for encoding. # Also remove trailing whitespace, but don't remove _initial_ @@ -614,13 +617,14 @@ class EditPage { $this->minoredit = false; $this->watchthis = false; $this->recreate = false; + + if ( $this->section == 'new' && $request->getVal( 'preloadtitle' ) ) { + $this->summary = $request->getVal( 'preloadtitle' ); + } } $this->oldid = $request->getInt( 'oldid' ); - # Section edit can come from either the form or a link - $this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) ); - $this->live = $request->getCheck( 'live' ); $this->editintro = $request->getText( 'editintro' ); -- 2.20.1