Fix submit button id on Special:Preferences
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 13 Sep 2017 19:58:25 +0000 (21:58 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 13 Sep 2017 20:06:51 +0000 (22:06 +0200)
For reasons beyond human fathoming, the button had the id set
to 'prefsubmit' in PHP code and then changed to 'prefcontrol'
in JS code. This functionality has been carefully preserved
across multiple rewrites of this code since 2004, when it was
added in 30d0ccd0 (rSVN3618). Let's just set the id in PHP.

Change-Id: Ib23bd0e481e73a51ff0a16731f47a2df11b2c1b8

includes/Preferences.php
maintenance/dictionary/mediawiki.dic
resources/src/mediawiki.special/mediawiki.special.preferences.js

index 0bb1d28..9349527 100644 (file)
@@ -1363,7 +1363,7 @@ class Preferences {
                $htmlForm->setSubmitText( $context->msg( 'saveprefs' )->text() );
                # Used message keys: 'accesskey-preferences-save', 'tooltip-preferences-save'
                $htmlForm->setSubmitTooltip( 'preferences-save' );
-               $htmlForm->setSubmitID( 'prefsubmit' );
+               $htmlForm->setSubmitID( 'prefcontrol' );
                $htmlForm->setSubmitCallback( [ 'Preferences', 'tryFormSubmit' ] );
 
                return $htmlForm;
index e7ba8fa..7c3c95d 100644 (file)
@@ -3181,7 +3181,7 @@ prefixsearchdisabled
 prefs
 prefsection
 prefsnologintext2
-prefsubmit
+prefcontrol
 preload
 preloads
 preloadtitle
index 63f2d98..6291f3f 100644 (file)
@@ -11,7 +11,6 @@
                        return this.id.replace( /^mw-prefsection/g, 'preftab' );
                };
 
-               $( '#prefsubmit' ).attr( 'id', 'prefcontrol' );
                $preftoc = $( '#preftoc' );
                $preferences = $( '#preferences' );