Webhook 편집 페이지에 i18n 키가 표시됩니다

I’m seeing this on the Webhooks edit page with 3.3.0.beta1-dev:

Two of the sections and their checkbox labels appear to be showing i18n keys instead of the values of those keys. E.g., I’m fairly sure that

[en.admin.web_hooks.voting_event.group_name]

is not the intended header for whatever category that’s supposed to be.

3개의 좋아요

Good catch!

You are not supposed to see the webhook of plugin that is not installed on your Discourse.

This is a regression from here:

https://github.com/discourse/discourse/commit/c46811092994d456e7a67b33669b76e51aaa3668#diff-2dd34e39ecc3176d116ca671641ae175f4d74db68e0db21f0eea477cdd45b818

Specifically here.
The symbols provided in TYPES don’t match the list values:

To the team, here is a possible solution:
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개의 좋아요

Thank you for reporting this issue :confetti_ball:

I fixed it today with in this PR

https://github.com/discourse/discourse/pull/26022

5개의 좋아요

This topic was automatically closed after 2 days. New replies are no longer allowed.