From 7e39185ec293d6c6f28c67217756e6277fbb371f Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 18 Feb 2018 05:29:35 +0000 Subject: [PATCH] 3.3-stable: Too large avatar breaks gantt when assignee is a group (#28204). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@17203 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 1 + test/unit/helpers/application_helper_test.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6889ba231..2b8054934 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1281,6 +1281,7 @@ module ApplicationHelper if email.present? gravatar(email.to_s.downcase, options) rescue nil else + options[:size] &&= options[:size].to_s image_tag 'anonymous.png', GravatarHelper::DEFAULT_OPTIONS .except(:default, :rating, :ssl).merge(options) diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 2285944af..ff8e4e28e 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -1307,6 +1307,7 @@ RAW assert_match tag_for_anonymous_re, avatar(nil) # Avatar for anonymous user assert_match tag_for_anonymous_re, avatar(User.anonymous) + assert avatar(User.anonymous, :size => 24).include?('width="24" height="24"') end end -- 2.39.5