Webhook编辑页面显示I18n键

抓得好!

您不应该看到未安装在 Discourse 上的插件的 webhook。

这是从这里开始的回归:

具体来说是这里。
TYPES 中提供的符号与列表值不匹配:

团队,这里有一个可能的解决方案:
def self.types_with_prefix(prefix)
  TYPES.select { |key, _value| key.to_s.start_with?(prefix.to_s) }.values
end

def self.active
  ids_to_exclude = []
  unless defined?(SiteSetting.solved_enabled) && SiteSetting.solved_enabled
    ids_to_exclude.concat(types_with_prefix(:solved))
  end
  unless defined?(SiteSetting.assign_enabled) && SiteSetting.assign_enabled
    ids_to_exclude.concat(types_with_prefix(:assign))
  end
  unless defined?(SiteSetting.voting_enabled) && SiteSetting.voting_enabled
    ids_to_exclude.concat(types_with_prefix(:voting_topic))
  end
  unless defined?(SiteSetting.chat_enabled) && SiteSetting.chat_enabled
    ids_to_exclude.concat(types_with_prefix(:chat_message))
  end
  self.where.not(id: ids_to_exclude.flatten)
end
6 个赞