Fork project page provides broken group image links
Summary
The fork project page includes broken image for groups with pictures.
Steps to reproduce
- Make sure you are member of a group with picture.
- Go to https://gitlab.com/gitlab-org/gitlab-ce/forks/new
What is the current bug behavior?
Generate HTML includes the following image-tag:
<img class="avatar s100 lazy" data-src="https://assets.gitlab-static.net/images/<img data-src="https://gitlab.com/uploads/-/system/group/avatar/942128/1701644.png" class=" lazy" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" />" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" />
Due to lazyloader.js
, this is transformed into:
<img class="avatar s100 js-lazy-loaded" src="https://assets.gitlab-static.net/images/<img data-src="https://gitlab.com/uploads/-/system/group/avatar/942128/1701644.png" class=" lazy" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" />">
Instead of the URL to the real image it contains another image tag inlined into the URL with an inline image. This URL is obviously bogus.
What is the expected correct behavior?
Group images should show up.
Output of checks
This bug happens on GitLab.com
Possible fixes
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb
index b78d307218..e8bab411b0 100644
--- a/app/helpers/namespaces_helper.rb
+++ b/app/helpers/namespaces_helper.rb
@@ -31,7 +31,7 @@ module NamespacesHelper
def namespace_icon(namespace, size = 40)
if namespace.is_a?(Group)
- group_icon(namespace)
+ group_icon_url(namespace)
else
avatar_icon(namespace.owner.email, size)
end