roman.lesnikov@gmail.com 3 ani în urmă
părinte
comite
eeea423e09

+ 2 - 0
inc/classes/BxDolCmts.php

@@ -2179,8 +2179,10 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
             $aStructure[$iI] = array(
                 'id' => $mixedItem['cmt_id'], 
                 'order' => isset($mixedItem['cmt_order']) ? $mixedItem['cmt_order'] : 0, 
+                'data' => $this->getCommentSimple((int)$mixedItem['cmt_id']),
                 'items' => array(),
             );
+            $aStructure[$iI]['data']['author_data'] = BxDolProfile::getData($aStructure[$iI]['data']['cmt_author_id']);
         }
 
         if(!$bItem || (int)$mixedItem['cmt_replies'] > 0) {

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -1525,7 +1525,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
 
     public function getDataCached($aEvent, $aBrowseParams = array())
     {
-        if(!$this->_oConfig->isCacheItem()) 
+        if(!$this->_oConfig->isCacheItem() || bx_is_api()) 
             return $this->getData($aEvent, $aBrowseParams);
 
         /**

+ 8 - 1
template/scripts/BxBaseCmts.php

@@ -144,10 +144,17 @@ class BxBaseCmts extends BxDolCmts
         $this->_prepareParams($aBp, $aDp);
 
         $aCmts = $this->getCommentsArray($aBp['vparent_id'], $aBp['filter'], $aBp['order'], $aBp['start'], $aBp[($aBp['init_view'] != -1 ? 'init' : 'per') . '_view']);
+        $aCmtsRv = [];
+        
+        foreach ($aCmts as $aCmt) {
+            $aCmtsRv[] = $this->getCommentStructure($aCmt['cmt_id'], $aBp, $aDp);
+        }
 
+       // print_r($aCmtsRv);
+        
         return [
             'unit' => 'comments',
-            'data' => $this->decodeData($aCmts),
+            'data' => $aCmtsRv,
         ];
     }