[BUGFIX] Move default avatar image from background css to img tag 91/45191/3
authorMichael Oehlhof <typo3@oehlhof.de>
Tue, 8 Dec 2015 23:49:23 +0000 (00:49 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Thu, 10 Dec 2015 04:48:59 +0000 (05:48 +0100)
If a transparent avatar image is assigned the default avatar no longer
shines through.

Resolves: #70220
Releases: master
Change-Id: I889c706616876d45d0d9a371b96591ec27aa264c
Reviewed-on: https://review.typo3.org/45191
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Build/Resources/Public/Less/Component/avatar.less
typo3/sysext/backend/Classes/Backend/Avatar/Avatar.php
typo3/sysext/install/Resources/Public/Css/InstallTool.css
typo3/sysext/t3skin/Resources/Public/Css/backend.css

index 40e58fa..0d1d67f 100644 (file)
@@ -62,8 +62,6 @@
        width: @avatar-size;
        overflow: hidden;
        border-radius: @avatar-border-radius;
-       background-image: url('@{path-sysext}/core/Resources/Public/Icons/T3Icons/avatar/avatar-default.svg');
-       background-size: 100%;
        &:after {
                display: block;
                content: '';
index 57e15f3..f808adf 100644 (file)
@@ -78,14 +78,19 @@ class Avatar
             $backendUser = $this->getBackendUser()->user;
         }
 
-        $imageTag = '';
         $avatarImage = $this->getImage($backendUser, $size);
 
-        if ($avatarImage) {
-            $imageTag = '<img src="' . htmlspecialchars($avatarImage->getUrl(true)) . '" ' .
-                'width="' . (int)$avatarImage->getWidth() . '" ' .
-                'height="' . (int)$avatarImage->getHeight() . '" />';
+        if (!$avatarImage) {
+            $avatarImage = GeneralUtility::makeInstance(
+                Image::class,
+                'typo3/sysext/core/Resources/Public/Icons/T3Icons/avatar/avatar-default.svg',
+                $size,
+                $size
+            );
         }
+        $imageTag = '<img src="' . htmlspecialchars($avatarImage->getUrl(true)) . '" ' .
+            'width="' . (int)$avatarImage->getWidth() . '" ' .
+            'height="' . (int)$avatarImage->getHeight() . '" />';
 
         return $imageTag;
     }
index 264f5c6..884efec 100644 (file)
@@ -7546,8 +7546,6 @@ button.close {
   width: 32px;
   overflow: hidden;
   border-radius: 50%;
-  background-image: url('../../../../../../typo3/sysext/core/Resources/Public/Icons/T3Icons/avatar/avatar-default.svg');
-  background-size: 100%;
 }
 .avatar-image:after {
   display: block;
index 848c289..808fab9 100644 (file)
@@ -7555,8 +7555,6 @@ button.close {
   width: 32px;
   overflow: hidden;
   border-radius: 50%;
-  background-image: url('../../../../../../typo3/sysext/core/Resources/Public/Icons/T3Icons/avatar/avatar-default.svg');
-  background-size: 100%;
 }
 .avatar-image:after {
   display: block;