]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1522601 - Uplift request question and answer don't show up as comments
authorKohei Yoshino <kohei.yoshino@gmail.com>
Thu, 24 Jan 2019 19:34:24 +0000 (14:34 -0500)
committerDylan William Hardison <dylan@hardison.net>
Thu, 24 Jan 2019 19:34:24 +0000 (14:34 -0500)
extensions/FlagTypeComment/web/js/ftc.js

index 84ebda0fe649a4dd1e928d933048515bcce6f942..6fc0601829ff90e7b8b21d73aaeede285e51926d 100644 (file)
@@ -169,9 +169,11 @@ Bugzilla.FlagTypeComment = class FlagTypeComment {
    * @returns {Boolean} Always `true` to allow submitting the form.
    */
   form_onsubmit() {
-    if (this.inserted_fieldsets.length) {
-      // Enable Markdown
-      this.$comment.form.querySelector('[name="markdown_off"]').remove();
+    const $markdown_off = this.$comment.form.querySelector('input[name="markdown_off"]');
+
+    // Enable Markdown for any regular patches. Phabricator requests don't come with this hidden `<input>`
+    if (this.inserted_fieldsets.length && $markdown_off) {
+      $markdown_off.remove();
     }
 
     for (const $fieldset of this.inserted_fieldsets) {