DEV: Don't eager load tags when tagging is not enabled.

DEV: Don’t eager load tags when tagging is not enabled.

diff --git a/lib/topic_query.rb b/lib/topic_query.rb
index d09701f..d296fc8 100644
--- a/lib/topic_query.rb
+++ b/lib/topic_query.rb
@@ -586,7 +586,8 @@ class TopicQuery
     options = @options
     options.reverse_merge!(per_page: per_page_setting)
 
-    result = Topic.includes(:tags, :allowed_users)
+    result = Topic.includes(:allowed_users)
+    result = result.includes(:tags) if SiteSetting.tagging_enabled
 
     if type == :group
       result = result.joins(

GitHub sha: 7719453fb73d66181508bf44e3abf104c3e71be9

This commit appears in #13546 which was approved by CvX. It was merged by tgxworld.