]> source.dussan.org Git - redmine.git/commitdiff
Issue#last_notes fallback does not respect notes visibility (#37155).
authorMarius Balteanu <marius.balteanu@zitec.com>
Sat, 28 May 2022 09:52:48 +0000 (09:52 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Sat, 28 May 2022 09:52:48 +0000 (09:52 +0000)
Patch by Jens Krämer.

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

app/models/issue.rb

index ab9f794dbc1bc114a1a446231895f1d6f1b1e28f..73fd3f8cd586a2c3a0dbc1a822ed1fefc40503d5 100644 (file)
@@ -1168,7 +1168,7 @@ class Issue < ActiveRecord::Base
     if @last_notes
       @last_notes
     else
-      journals.where.not(notes: '').reorder(:id => :desc).first.try(:notes)
+      journals.visible.where.not(notes: '').reorder(:id => :desc).first.try(:notes)
     end
   end