Composer Help Button

https://commonmark.org/help/

4 Likes

I’ve been using the Composer Help Button Plugin which has worked up until I just updated to version 3.2.0.beta2-dev latest-release +246

I would appreciate any help or insights!

Here is the contents of the log file when I click the plugin’s composer button…

composer-help.js:21 Uncaught TypeError: Cannot read properties of undefined (reading ‘ajax’)
at e.init (composer-help.js:21:1)
at e.r [as init] (index.js:383:1)
at g (core_object.js:122:1)
at e.create (core_object.js:626:1)
at v.create (index.js:446:1)
at index.js:302:1
at l (index.js:245:1)
at o.lookup (index.js:130:1)
at e.lookup (container_proxy.js:79:1)
at l.show (modal.js:162:32)
at i (show-modal.js:35:23)
at e.showComposerHelp (composer-help.js:15:1)
at B._run (index.ts:665:23)
at B._join (index.ts:640:19)
at B.join (index.ts:362:17)
at p (index.js:156:1)
at index.js:707:1
at e.flaggedInstrument (index.js:126:1)
at index.js:706:1
at index.js:665:1
at runtime.js:5762:1
at o._triggerAction (d-button.gjs:187:13)
at o.click (d-button.gjs:151:17)
init @ composer-help.js:21
r @ index.js:383
g @ core_object.js:122
create @ core_object.js:626
create @ index.js:446
(anonymous) @ index.js:302
l @ index.js:245
lookup @ index.js:130
lookup @ container_proxy.js:79
show @ modal.js:162
i @ show-modal.js:35
showComposerHelp @ composer-help.js:15
B._run @ index.ts:665
B._join @ index.ts:640
B.join @ index.ts:362
p @ index.js:156
(anonymous) @ index.js:707
e.flaggedInstrument @ index.js:126
(anonymous) @ index.js:706
(anonymous) @ index.js:665
(anonymous) @ runtime.js:5762
_triggerAction @ d-button.gjs:187
click @ d-button.gjs:151

Here is the portion underlined red in in the console…

_ajax.default.ajax(Discourse.SiteSettings.composer_help_modal_url + '.json').then(function (resp) {

Here is the plugin’s javascript file…

define("discourse/plugins/discourse-plugin-composer-help-button/discourse/controllers/composer-help", ["exports", "discourse/mixins/modal-functionality", "discourse/lib/ajax"], function (_exports, _modalFunctionality, _ajax) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.default = void 0;
  0; //eaimeta@70e063a35619d71f0,"discourse/mixins/modal-functionality",0,"discourse/lib/ajax"eaimeta@70e063a35619d71f
  var _default = _exports.default = Ember.Controller.extend(_modalFunctionality.default, {
    loading: true,
    parsedContent: '',
    refresh: function () {
      this.set("loading", true);
    },
    init: function () {
      this._super();
      this.setProperties({
        "loading": true,
        "parsedContent": ''
      });
      _ajax.default.ajax(Discourse.SiteSettings.composer_help_modal_url + '.json').then(function (resp) {
        this.set('parsedContent', resp.post_stream.posts[0].cooked);
        this.refresh();
      }.bind(this));
    }
  });
});

Hi! I just recently installed this plugin and also noticed that the help button is not working.