From 01765454b2f59fe7542149c64ece91f67cbfe060 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Wed, 15 Jul 2020 09:32:45 +1000 Subject: [PATCH] FIX: compatibility after allowlist rewording in Discourse --- plugin.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugin.rb b/plugin.rb index 2092c82..4a6e1fa 100644 --- a/plugin.rb +++ b/plugin.rb @@ -19,8 +19,15 @@ after_initialize do User.register_custom_field_type('signature_raw', :text) register_editable_user_custom_field [:see_signatures, :signature_url, :signature_raw] - whitelist_public_user_custom_field :signature_cooked - whitelist_public_user_custom_field :signature_url + + # TODO Drop after Discourse 2.6.0 release + if respond_to?(:whitelist_public_user_custom_field) + whitelist_public_user_custom_field :signature_cooked + whitelist_public_user_custom_field :signature_url + else + allow_public_user_custom_field :signature_cooked + allow_public_user_custom_field :signature_url + end add_to_serializer(:post, :user_signature) { if SiteSetting.signatures_advanced_mode then