mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Pass topic to TopicView.add_post_custom_fields_allowlister (#14678)
Allows custom fields to be loaded based on the attributes of a topic.
This commit is contained in:
committed by
GitHub
parent
c7703cec2f
commit
d1201d6188
@@ -326,8 +326,8 @@ class Plugin::Instance
|
||||
# Add a post_custom_fields_allowlister block to the TopicView, respecting if the plugin is enabled
|
||||
def topic_view_post_custom_fields_allowlister(&block)
|
||||
reloadable_patch do |plugin|
|
||||
::TopicView.add_post_custom_fields_allowlister do |user|
|
||||
plugin.enabled? ? block.call(user) : []
|
||||
::TopicView.add_post_custom_fields_allowlister do |user, topic|
|
||||
plugin.enabled? ? block.call(user, topic) : []
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user