]> source.dussan.org Git - redmine.git/commitdiff
Fix slow display of projects list when including project description column (#40610).
authorGo MAEDA <maeda@farend.jp>
Tue, 14 May 2024 07:44:05 +0000 (07:44 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 14 May 2024 07:44:05 +0000 (07:44 +0000)
Patch by Go MAEDA (@maeda).

git-svn-id: https://svn.redmine.org/redmine/trunk@22829 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/projects_queries_helper.rb

index 3319576513c240dec2a97784a95e7aaf7693bd3c..dc540a432b339ac44def6d34de42be9a9792be15 100644 (file)
@@ -27,7 +27,13 @@ module ProjectsQueriesHelper
           (tag.span(class: 'icon icon-user my-project', title: l(:label_my_projects)) if User.current.member_of?(item)) +
           (tag.span(class: 'icon icon-bookmarked-project', title: l(:label_my_bookmarks)) if User.current.bookmarked_project_ids.include?(item.id))
       when :short_description
-        item.description? ? content_tag('div', textilizable(item, :short_description), :class => "wiki") : ''
+        if item.description?
+          # Sets :inline_attachments to false to avoid performance issues
+          # caused by unnecessary loading of attachments
+          content_tag('div', textilizable(item, :short_description, :inline_attachments => false), :class => 'wiki')
+        else
+          ''
+        end
       when :homepage
         item.homepage? ? content_tag('div', textilizable(item, :homepage), :class => "wiki") : ''
       when :status