mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
FIX: handle embed count when topic not found
This commit is contained in:
parent
87f6aadb7e
commit
bfefda06f6
1 changed files with 5 additions and 1 deletions
|
@ -69,7 +69,11 @@ class EmbedController < ApplicationController
|
||||||
topic_embeds.each do |te|
|
topic_embeds.each do |te|
|
||||||
url = te.embed_url
|
url = te.embed_url
|
||||||
url = "#{url}#discourse-comments" unless params[:embed_url].include?(url)
|
url = "#{url}#discourse-comments" unless params[:embed_url].include?(url)
|
||||||
by_url[url] = I18n.t('embed.replies', count: te.topic.posts_count - 1)
|
if te.topic.present?
|
||||||
|
by_url[url] = I18n.t('embed.replies', count: te.topic.posts_count - 1)
|
||||||
|
else
|
||||||
|
by_url[url] = I18n.t('embed.replies', count: 0)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue