]> source.dussan.org Git - redmine.git/commitdiff
3.4-stable: Too large avatar breaks gantt when assignee is a group (#28204).
authorGo MAEDA <maeda@farend.jp>
Sun, 18 Feb 2018 05:21:22 +0000 (05:21 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 18 Feb 2018 05:21:22 +0000 (05:21 +0000)
Patch by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17202 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
test/unit/helpers/application_helper_test.rb

index c5d4c76a7def938220ed3336f141d06b682a5010..f2bb2a96582f03dcba43a06985ad60f7b72df025 100644 (file)
@@ -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)
index 941ba7ef05190ba01414f6d89734fae394ba686d..8df4f60fcd3f9fea74b925891be220b138684978 100644 (file)
@@ -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