Browse code

[Hotfix] Do not parse image template when not checked in memberlist and reader

Sebastian Zoglowek authored on25/05/2022 16:56:24
Showing4 changed files
... ...
@@ -277,8 +277,10 @@ class Member extends Frontend
277 277
      */
278 278
     public static function parseMemberAvatar(MemberModel $objMember, &$objTemplate, $strImgSize)
279 279
     {
280
+        $objTemplate->addImage= true;
281
+
280 282
         $objTemplate->singleSRC = self::DEFAULT_PICTURE;
281
-        $objTemplate->addImage = false;
283
+        $objTemplate->addFallbackImage = true;
282 284
 
283 285
         $uuidDefault = Config::get('defaultAvatar');
284 286
 
... ...
@@ -303,7 +305,7 @@ class Member extends Frontend
303 305
             return;
304 306
         }
305 307
 
306
-        $objTemplate->addImage = true;
308
+        $objTemplate->addFallbackImage = false;
307 309
         $arrData = ['singleSRC'=>$objFile->path, 'size'=>$strImgSize];
308 310
 
309 311
         //ToDo: Change to FigureBuilder in the future
... ...
@@ -1,8 +1,8 @@
1 1
 <figure class="image_container">
2 2
 
3
-  <?php if($this->addImage): ?>
4
-    <?php $this->insert('picture_default', $this->picture); ?>
5
-  <?php else: ?>
3
+  <?php if($this->addFallbackImage): ?>
6 4
     <img src="<?= $this->singleSRC; ?>" width="200" height="200" itemprop="image">
5
+  <?php else: ?>
6
+    <?php $this->insert('picture_default', $this->picture); ?>
7 7
   <?php endif; ?>
8 8
 </figure>
... ...
@@ -1,11 +1,15 @@
1 1
 <div class="member_list_default">
2
-  <?php $this->insert('memberExtension_image', $this->arrData); ?>
2
+
3
+  <?php if($this->addImage): ?>
4
+    <?php $this->insert('memberExtension_image', $this->arrData); ?>
5
+  <?php endif; ?>
3 6
 
4 7
   <ul>
5 8
     <?php foreach ($this->fields as $k => $v): ?>
6 9
       <li class="<?= $k ?>"><?= $v ?></li>
7 10
     <?php endforeach; ?>
8 11
   </ul>
12
+
9 13
   <?php if($this->link): ?>
10 14
     <a href="<?=$this->link?>"><?=$GLOBALS['TL_LANG']['MSC']['memberDetail']?></a>
11 15
   <?php endif; ?>
... ...
@@ -1,5 +1,8 @@
1 1
 <div class="member_reader_full">
2
-  <?php $this->insert('memberExtension_image', $this->arrData); ?>
2
+
3
+  <?php if($this->addImage): ?>
4
+    <?php $this->insert('memberExtension_image', $this->arrData); ?>
5
+  <?php endif; ?>
3 6
 
4 7
   <ul>
5 8
     <?php foreach ($this->fields as $k => $v): ?>