UltrasonicNXT has submitted this change and it was merged.

Change subject: Fix error when creating a new thread with no title
......................................................................


Fix error when creating a new thread with no title

Also then reload the text that was entered back into the form
As reported by BradLeeBH

Change-Id: I4c356844577b2073b400f26677b2d79710905d3b
---
M Forum.php
M SpecialWikiForum.php
M Thread.php
M WikiForum.php
4 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  UltrasonicNXT: Verified; Looks good to me, approved



diff --git a/Forum.php b/Forum.php
index afd32fd..d4ecac1 100644
--- a/Forum.php
+++ b/Forum.php
@@ -685,11 +685,11 @@
         *
         * @return string: HTML the editor
         */
-       function showNewThreadForm() {
+       function showNewThreadForm( $preloadTitle, $preloadText ) {
                return WFThread::showGeneralEditor(
-                       '',
+                       $preloadTitle,
                        wfMessage( 'wikiforum-thread-title' )->text(),
-                       '',
+                       $preloadText,
                        array(
                                'wfaction' => 'savenewthread',
                                'forum' => $this->getId()
diff --git a/SpecialWikiForum.php b/SpecialWikiForum.php
index 7d97c06..4411ded 100644
--- a/SpecialWikiForum.php
+++ b/SpecialWikiForum.php
@@ -147,7 +147,7 @@
                                                                break;
 
                                                        case 'addthread':
-                                                               $output .= 
$forum->showNewThreadForm();
+                                                               $output .= 
$forum->showNewThreadForm( '', '' );
                                                                break;
                                                        case 'savenewthread':
                                                                $output .= 
$forum->addThread( $title, $text );
diff --git a/Thread.php b/Thread.php
index c12ca16..409d4f7 100644
--- a/Thread.php
+++ b/Thread.php
@@ -783,7 +783,7 @@
 
                if ( strlen( $text ) == 0 || strlen( $title ) == 0 ) { // show 
form again, return it
                        $error = WikiForumClass::showErrorMessage( 
'wikiforum-error-add', 'wikiforum-error-no-text-or-title' );
-                       return $error . $forum->showNewThreadEditor();
+                       return $error . $forum->showNewThreadForm( $title, 
$text );
                }
 
                if ( WFThread::titleExists( $title ) ) {
diff --git a/WikiForum.php b/WikiForum.php
index 39e3f08..1a8522c 100644
--- a/WikiForum.php
+++ b/WikiForum.php
@@ -35,7 +35,7 @@
        'path' => __FILE__,
        'name' => 'WikiForum',
        'author' => array( 'Michael Chlebek', 'Jack Phoenix', 'Adam Carter 
(UltrasonicNXT)' ),
-       'version' => '2.2.0',
+       'version' => '2.2.1',
        'url' => 'https://www.mediawiki.org/wiki/Extension:WikiForum',
        'descriptionmsg' => 'wikiforum-desc'
 );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4c356844577b2073b400f26677b2d79710905d3b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiForum
Gerrit-Branch: master
Gerrit-Owner: UltrasonicNXT <adamr_car...@btinternet.com>
Gerrit-Reviewer: UltrasonicNXT <adamr_car...@btinternet.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to