Poll Defaults

Install this theme component

This simple theme component allows some control over the default poll behaviour. It was inspired by this Topic:


Other settings could easily be added if needed.


THANK YOU! I’ve already got this installed on my forum and I’m looking forward to fewer “Oops” moments for the folks who participate on our forum.


This looks to be broken at the mo:

I’ll take a look when I get the chance, but PRs are always welcome!

1 Like


I was looking at this code:

I think you can do the following:

api.modifyClass("component:modal/poll-ui-builder", {
  pluginId: 'poll-defaults',
  didInsertElement() {
    this._super(...arguments); // super.didInsertElement(...arguments); doesn't work (?)

    if (settings.Public) {this.set('publicPoll', true)}
    if (settings.Advanced) {this.set('showAdvanced', true)}

It works.

However, I’m perplexed with didInsertElement.
poll-ui-builder is now a glimmer component. didInsertElement is not supposed to exist based on the ember upgrading guide.
I can see in core some usage. Maybe some specificity in Discourse?
Also, I’m not sure why super.didInsertElement doesn’t exist in this above code context.

1 Like

This is now part of core: :partying_face:


Nice!! This makes the TC nicely obsolete. I consider this mission accomplished :wink:

So … how do we change the default to private ?

There is a site setting


Thanks !