Remove the topic_featured_link_onebox setting. We will always try to onebox a link and add it to the body if topic_featured_link_enabled is enabled.

This commit is contained in:
Neil Lalonde
2016-12-09 13:28:12 -05:00
parent f07443b488
commit a4c4f13901
7 changed files with 8 additions and 31 deletions

View File

@ -104,11 +104,6 @@ class PostCreator
end
end
onebox_featured_link = SiteSetting.topic_featured_link_enabled && SiteSetting.topic_featured_link_onebox && guardian.can_edit_featured_link?(find_category_id)
if onebox_featured_link
@opts[:raw] = DiscourseFeaturedLink.cache_onebox_link(@opts[:featured_link])
end
setup_post
return true if skip_validations?
@ -122,7 +117,7 @@ class PostCreator
DiscourseEvent.trigger :before_create_post, @post
DiscourseEvent.trigger :validate_post, @post
post_validator = Validators::PostValidator.new(skip_topic: true, skip_post_body: onebox_featured_link)
post_validator = Validators::PostValidator.new(skip_topic: true)
post_validator.validate(@post)
valid = @post.errors.blank?