From e11f77a4b038ae19e7987d5e546710ce9b7d839e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 31 Jan 2015 10:42:41 +0000 Subject: Show long text custom field changes as a diff (#15236). git-svn-id: http://svn.redmine.org/redmine/trunk@13954 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/journals_controller.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb index fd75d752a..bae6ca2bc 100644 --- a/app/controllers/journals_controller.rb +++ b/app/controllers/journals_controller.rb @@ -49,9 +49,17 @@ class JournalsController < ApplicationController if params[:detail_id].present? @detail = @journal.details.find_by_id(params[:detail_id]) else - @detail = @journal.details.detect {|d| d.prop_key == 'description'} + @detail = @journal.details.detect {|d| d.property == 'attr' && d.prop_key == 'description'} + end + unless @issue && @detail + render_404 + return false + end + if @detail.property == 'cf' + unless @detail.custom_field && @detail.custom_field.visible_by?(@issue.project, User.current) + raise ::Unauthorized + end end - (render_404; return false) unless @issue && @detail @diff = Redmine::Helpers::Diff.new(@detail.value, @detail.old_value) end -- cgit v1.2.3