AntonLV 9 лет назад
Родитель
Сommit
64ebfa8c06

+ 2 - 2
inc/classes/BxDolContentInfo.php

@@ -202,9 +202,9 @@ class BxDolContentInfo extends BxDolFactory implements iBxDolFactoryObject
         return $this->_call('get_link', $iContentId);
     }
 
-    public function getContentDesc ($iContentId)
+    public function getContentText ($iContentId)
     {
-        return $this->_call('get_desc', $iContentId);
+        return $this->_call('get_text', $iContentId);
     }
 
     public function getContentInfo ($iContentId, $bSearchableFieldsOnly = true)

+ 15 - 10
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -35,40 +35,45 @@ class BxBaseModGeneralModule extends BxDolModule
     // ====== SERVICE METHODS
     public function serviceGetAuthor ($iContentId)
     {
-        return $this->_getFieldValue('FIELD_AUTHOR', $iContentId);
+        $mixedResult = $this->_getFieldValue('FIELD_AUTHOR', $iContentId);
+        return $mixedResult !== false ? (int)$mixedResult : 0; 
     }
 
     public function serviceGetDateAdded ($iContentId)
     {
-        return $this->_getFieldValue('FIELD_ADDED', $iContentId);
+        $mixedResult = $this->_getFieldValue('FIELD_ADDED', $iContentId);
+        return $mixedResult !== false ? (int)$mixedResult : 0; 
     }
 
     public function serviceGetDateChanged ($iContentId)
     {
-        return $this->_getFieldValue('FIELD_CHANGED', $iContentId);
+        $mixedResult = $this->_getFieldValue('FIELD_CHANGED', $iContentId);
+        return $mixedResult !== false ? (int)$mixedResult : 0;
     }
 
     public function serviceGetLink ($iContentId)
     {
         $CNF = &$this->_oConfig->CNF;
         if(empty($CNF['URI_VIEW_ENTRY']))
-            return false;
+            return '';
 
         $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
         if(empty($aContentInfo))
-            return false;
+            return '';
 
         return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
     }
 
     public function serviceGetTitle ($iContentId)
     {
-        return $this->_getFieldValue('FIELD_TITLE', $iContentId);
+        $mixedResult = $this->_getFieldValue('FIELD_TITLE', $iContentId);
+        return $mixedResult !== false ? $mixedResult : '';
     }
 
     public function serviceGetText ($iContentId)
     {
-        return $this->_getFieldValue('FIELD_TEXT', $iContentId);
+        $mixedResult = $this->_getFieldValue('FIELD_TEXT', $iContentId);
+        return $mixedResult !== false ? $mixedResult : '';
     }
 
     public function serviceGetInfo ($iContentId, $bSearchableFieldsOnly = true)
@@ -77,17 +82,17 @@ class BxBaseModGeneralModule extends BxDolModule
 
         $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
         if(empty($aContentInfo))
-            return false;
+            return array();
 
         if(!$bSearchableFieldsOnly)
             return $aContentInfo;
 
         if(empty($CNF['PARAM_SEARCHABLE_FIELDS']))
-            return false;
+            return array();
 
         $aFields = explode(',', getParam($CNF['PARAM_SEARCHABLE_FIELDS']));
         if(empty($aFields))
-            return false;
+            return array();
 
         return array_flip(array_intersect(array_flip($aContentInfo), $aFields));
     }

+ 2 - 1
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -57,7 +57,8 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
         if(empty($sTranscoder) && !empty($CNF['OBJECT_IMAGES_TRANSCODER_THUMB']))
             $sTranscoder = $CNF['OBJECT_IMAGES_TRANSCODER_THUMB'];
 
-        return $this->_getFieldValueThumb('FIELD_PICTURE', $iContentId, $sTranscoder);
+        $mixedResult = $this->_getFieldValueThumb('FIELD_PICTURE', $iContentId, $sTranscoder);
+        return $mixedResult !== false ? $mixedResult : '';
     }
 
 	public function servicePrivateProfileMsg()

+ 2 - 1
modules/base/text/classes/BxBaseModTextModule.php

@@ -27,7 +27,8 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
         if(empty($sTranscoder) && !empty($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY']))
             $sTranscoder = $CNF['OBJECT_IMAGES_TRANSCODER_GALLERY'];
 
-        return $this->_getFieldValueThumb('FIELD_THUMB', $iContentId, $sTranscoder);
+        $mixedResult = $this->_getFieldValueThumb('FIELD_THUMB', $iContentId, $sTranscoder);
+        return $mixedResult !== false ? $mixedResult : '';
     }
 
 	public function serviceGetMenuAddonManageTools()