Author: ilia-kats
Description:
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();
Version: master
Severity: normal