(bug 31405) block reason preload. Patch by Brad Jorsch.
authorHappy-melon <happy-melon@users.mediawiki.org>
Mon, 17 Oct 2011 16:16:26 +0000 (16:16 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Mon, 17 Oct 2011 16:16:26 +0000 (16:16 +0000)
includes/HTMLForm.php

index 5a46ee6..a9cbc79 100644 (file)
@@ -1706,7 +1706,17 @@ class HTMLSelectAndOtherField extends HTMLSelectField {
 
                } else {
                        $final = $this->getDefault();
-                       $list = $text = '';
+
+                       $list = 'other';
+                       $text = $final;
+                       foreach ( $this->mFlatOptions as $option ) {
+                               $match = $option . wfMsgForContent( 'colon-separator' );
+                               if( strpos( $text, $match ) === 0 ) {
+                                       $list = $option;
+                                       $text = substr( $text, strlen( $match ) );
+                                       break;
+                               }
+                       }
                }
                return array( $final, $list, $text );
        }