hokkey / redmine_chatwork

A Redmine plugin to notify updates to ChatWork rooms
http://www.redmine.org/plugins/redmine_chatwork
MIT License
10 stars 16 forks source link

can't get value from `plugin_redmine_chatwork` #7

Open YasKaneda opened 6 years ago

YasKaneda commented 6 years ago

I have installed your plugin into our redmine(3.4.2.stable) and found an issue regarding plugin setting acquisition due to using hash/symbol.

I set debug logs in controller_issues_edit_after_save as follows:

plugin_redmine_chatwork = Setting.plugin_redmine_chatwork
post_updates_symbol = Setting.plugin_redmine_chatwork[:post_updates]
post_updates_subscript = Setting.plugin_redmine_chatwork["post_updates"]

Rails.logger.info("plugin_redmine_chatwork : #{plugin_redmine_chatwork}")
Rails.logger.info("post_updates_symbol : #{post_updates_symbol}")
Rails.logger.info("post_updates_subscript : #{post_updates_subscript}")

and I got result as follows:

plugin_redmine_chatwork : {"token"=>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "room"=>"https://kcw.kddi.ne.jp/#!rid99999999", "post_updates"=>"1", "post_wiki_updates"=>"1"}
post_updates_symbol : 
post_updates_subscript : 1

Could you please fix this so that we can obtain plugin_redmine_chatwork?

ref: https://github.com/sciyoshi/redmine-slack/blob/master/lib/redmine_slack/listener.rb#L35 https://github.com/sciyoshi/redmine-slack/blob/master/lib/redmine_slack/listener.rb#L47 https://github.com/sciyoshi/redmine-slack/blob/master/lib/redmine_slack/listener.rb#L108 https://github.com/sciyoshi/redmine-slack/blob/master/lib/redmine_slack/listener.rb#L206

Sieg-Fried commented 6 years ago

But, may not be able to read the value due to this correction. It's better to compare with 'nil' and verify the value. If value is 'nil', it's better to get value by the previous reference method.