https://bugzilla.wikimedia.org/show_bug.cgi?id=43910

       Web browser: Firefox
            Bug ID: 43910
           Summary: AJAX button not working on MW 1.20
           Product: MediaWiki extensions
           Version: master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: Drafts
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

Upon clicking the Save Draft button, the page is normally saved and I am
redirected to the page view, where my changes have been incorporated. A draft
is not saved, the error console says ReferenceError: wgDraft is not defined.
The following changes need to be applied to make it work:

--- Drafts.hooks.php.bak        2013-01-12 20:28:03.000000000 +0100
+++ Drafts.hooks.php    2013-01-12 20:29:00.000000000 +0100
@@ -211,7 +211,7 @@
                        }
                        $ajaxButton = Xml::escapeJsString(
                                Xml::element( 'input',
-                                       array( 'type' => 'submit' ) +
$buttonAttribs
+                                       array( 'type' => 'button' ) +
$buttonAttribs
                                        + ( $wgRequest->getText( 'action' ) !==
'submit' ?
                                                array ( 'disabled' =>
'disabled' )
                                                : array()

--- modules/ext.Drafts.js.bak   2013-01-12 20:08:37.000000000 +0100
+++ modules/ext.Drafts.js       2013-01-12 20:27:45.000000000 +0100
@@ -194,5 +194,5 @@
        }
 }

-var wgDraft = new Draft();
+window["wgDraft"] = new Draft();
 wgDraft.initialize();

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to