FIX: check if allow_staff_user_custom_field exisits
This commit is contained in:
parent
00cbecc5a4
commit
88842e12df
12
plugin.rb
12
plugin.rb
|
@ -240,19 +240,19 @@ after_initialize do
|
||||||
register_user_custom_field_type(DiscourseCalendar::HOLIDAY_CUSTOM_FIELD, :boolean)
|
register_user_custom_field_type(DiscourseCalendar::HOLIDAY_CUSTOM_FIELD, :boolean)
|
||||||
|
|
||||||
# TODO Drop after Discourse 2.6.0 release
|
# TODO Drop after Discourse 2.6.0 release
|
||||||
if respond_to?(:whitelist_staff_user_custom_field)
|
if respond_to?(:allow_staff_user_custom_field)
|
||||||
whitelist_staff_user_custom_field(DiscourseCalendar::HOLIDAY_CUSTOM_FIELD)
|
|
||||||
else
|
|
||||||
allow_staff_user_custom_field(DiscourseCalendar::HOLIDAY_CUSTOM_FIELD)
|
allow_staff_user_custom_field(DiscourseCalendar::HOLIDAY_CUSTOM_FIELD)
|
||||||
|
else
|
||||||
|
whitelist_staff_user_custom_field(DiscourseCalendar::HOLIDAY_CUSTOM_FIELD)
|
||||||
end
|
end
|
||||||
|
|
||||||
register_editable_user_custom_field(DiscourseCalendar::REGION_CUSTOM_FIELD)
|
register_editable_user_custom_field(DiscourseCalendar::REGION_CUSTOM_FIELD)
|
||||||
|
|
||||||
# TODO Drop after Discourse 2.6.0 release
|
# TODO Drop after Discourse 2.6.0 release
|
||||||
if respond_to?(:whitelist_staff_user_custom_field)
|
if respond_to?(:allow_staff_user_custom_field)
|
||||||
whitelist_staff_user_custom_field(DiscourseCalendar::REGION_CUSTOM_FIELD)
|
|
||||||
else
|
|
||||||
allow_staff_user_custom_field(DiscourseCalendar::REGION_CUSTOM_FIELD)
|
allow_staff_user_custom_field(DiscourseCalendar::REGION_CUSTOM_FIELD)
|
||||||
|
else
|
||||||
|
whitelist_staff_user_custom_field(DiscourseCalendar::REGION_CUSTOM_FIELD)
|
||||||
end
|
end
|
||||||
|
|
||||||
on(:site_setting_changed) do |name, old_value, new_value|
|
on(:site_setting_changed) do |name, old_value, new_value|
|
||||||
|
|
Loading…
Reference in New Issue