diff options
author | Go MAEDA <maeda@farend.jp> | 2018-02-18 05:21:22 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2018-02-18 05:21:22 +0000 |
commit | 0037cef83dc13d51633a7457cf5898db496c282c (patch) | |
tree | b753d7708fb8a234dddd23a14facc14307352ed1 | |
parent | 5ed8c8e511ce61727b4c750c62b247d73cc3075c (diff) | |
download | redmine-0037cef83dc13d51633a7457cf5898db496c282c.tar.gz redmine-0037cef83dc13d51633a7457cf5898db496c282c.zip |
3.4-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.4-stable@17202 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/application_helper.rb | 1 | ||||
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c5d4c76a7..f2bb2a965 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1424,6 +1424,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 941ba7ef0..8df4f60fc 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -1344,6 +1344,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 |