mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Fix bug where links to posts weren't being tracked
This commit is contained in:
@@ -53,6 +53,15 @@ class TopicLink < ActiveRecord::Base
|
||||
|
||||
topic_id = route[:topic_id]
|
||||
post_number = route[:post_number] || 1
|
||||
|
||||
# Store the canonical URL
|
||||
topic = Topic.where(id: topic_id).first
|
||||
|
||||
if topic.present?
|
||||
url = "#{Discourse.base_url}#{topic.relative_url}"
|
||||
url << "/#{post_number}" if post_number.to_i > 1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Skip linking to ourselves
|
||||
|
||||
Reference in New Issue
Block a user