summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-03-18 07:44:42 +0000
committerGo MAEDA <maeda@farend.jp>2021-03-18 07:44:42 +0000
commit0d96c4ebdb1cceeb6cac8f940a11b5407a0a5211 (patch)
tree561729fdf13f0ce915df1f3b942928f7f568fd32 /app
parenta11f9eb5d9d01b59399be616ee62c6d75445aab6 (diff)
downloadredmine-0d96c4ebdb1cceeb6cac8f940a11b5407a0a5211.tar.gz
redmine-0d96c4ebdb1cceeb6cac8f940a11b5407a0a5211.zip
Show project ID instead of name in issue journal details if the project is not visible for the current user (#33360).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20819 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/issues_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 566cd1d53..363d970c8 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -637,6 +637,7 @@ module IssuesHelper
end
# Find the name of an associated record stored in the field attribute
+ # For project, return the associated record only if is visible for the current User
def find_name_by_reflection(field, id)
return nil if id.blank?
@@ -645,7 +646,7 @@ module IssuesHelper
name = nil
if association
record = association.klass.find_by_id(key.last)
- if record
+ if (record && !record.is_a?(Project)) || (record.is_a?(Project) && record.visible?)
name = record.name.force_encoding('UTF-8')
end
end