From: Roan Kattouw Date: Tue, 26 Feb 2008 22:40:59 +0000 (+0000) Subject: (bug 13100) Added 'preloadtitle' parameter to action=edit§ion=new that pre-fills... X-Git-Tag: 1.31.0-rc.0~49328 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=504426ec66bea3ca7c2a2ea26da03e813a37e8c0;p=lhc%2Fweb%2Fwiklou.git (bug 13100) Added 'preloadtitle' parameter to action=edit§ion=new that pre-fills the section title field. Patch by Mike Dillon --- 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' );