Explorar o código

#4558 Build-in API support enhancement

roman.lesnikov@gmail.com %!s(int64=2) %!d(string=hai) anos
pai
achega
7808e5284d

+ 5 - 3
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -761,12 +761,14 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if(isset($aEvent[$sKey]) && $aEvent[$sKey] !== CHECK_ACTION_RESULT_ALLOWED) 
             return '';
 
-        if($this->_bIsApi)
+        self::$_aMemoryCacheItemsData[$sMemoryCacheItemsKey] = $aEvent;
+        
+        if($this->_bIsApi){
+            self::$_aMemoryCacheItems[$sMemoryCacheItemsKey] = 'OK';
             return 'OK';
+        }
 
         self::$_aMemoryCacheItems[$sMemoryCacheItemsKey] = $this->_getPost($aEvent['content_type'], $aEvent, $aBrowseParams);
-        self::$_aMemoryCacheItemsData[$sMemoryCacheItemsKey] = $aEvent;
-
         return self::$_aMemoryCacheItems[$sMemoryCacheItemsKey];
     }
 

+ 1 - 1
template/scripts/BxBaseRecommendationProfile.php

@@ -24,7 +24,7 @@ class BxBaseRecommendationProfile extends BxDolRecommendationProfile
     {
         $oProfile = BxDolProfile::getInstance($iId);
         if(!$oProfile)
-            return '';
+            return $this->_bIsApi ? [] : '';
 
         return $oProfile->{'getUnit' . ($this->_bIsApi ? 'API' : '')}(0, [
             'template' => 'unit_with_cover',