Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix form when SLACK_CHANNELS contains only one entry #152

Merged
merged 1 commit into from
Mar 8, 2016

Conversation

nickstenning
Copy link
Contributor

e35a05b introduced a problem -- the form sends channel=null when SLACK_CHANNELS contains only one entry, but the relevant form handler doesn't seem to cope with this scenario.

I figured the easiest way to fix this was to inject an <input type="hidden"> in the single-channel case. This seems to work nicely, after a small tweak to the client-side form handler.

Fixes #77.

@neemah
Copy link

neemah commented Mar 3, 2016

I am very interesting in fixing this issue, we deployed project on heroku and it does not work with 1 channel :(

@rauchg could you please say when you will be able to look into it? Thanks in advance!

@carmstrong
Copy link

Anything we can do to help usher this along? Running into this issue and happy to test.

@carmstrong
Copy link

Merged this PR onto master and is working great. Thanks @nickstenning!

rauchg added a commit that referenced this pull request Mar 8, 2016
Fix form when SLACK_CHANNELS contains only one entry
@rauchg rauchg merged commit cee59be into rauchg:master Mar 8, 2016
andrewsardone added a commit to andrewsardone/slackin that referenced this pull request Mar 10, 2016
Introduced with the merge of rauchg#152,
the problem was if the `SLACK_CHANNELS` environment variable wasn't set
up, then no hidden form element with the listed channels would be
included. Therefore, our `channel` variable would be `undefined`, and a
direct access of the `value` property would crash the app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single-channel config resulting in "Not a permitted channel"
4 participants