Просмотр исходного кода

Ticket #3606 - Timeline: PHP notices\warnings when reposted item is displayed.

AntonLV 4 лет назад
Родитель
Сommit
100978b4ac

+ 16 - 12
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -1191,18 +1191,20 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
     /**
      * Entry post for Timeline module
      */
-    public function serviceGetTimelineProfilePicture($aEvent, $aBrowseParams = array())
+    public function serviceGetTimelineProfilePicture($aEvent, $aBrowseParams = [])
     {
-        $aResult = $this->_serviceGetTimelineProfileImage($aEvent, $aBrowseParams, array(
+        $aResult = $this->_serviceGetTimelineProfileImage($aEvent, $aBrowseParams, [
             'stg' => 'OBJECT_STORAGE',
-            'trans' => array('OBJECT_IMAGES_TRANSCODER_GALLERY', 'OBJECT_IMAGES_TRANSCODER_AVATAR'),
-            'trans_orig' => array('OBJECT_IMAGES_TRANSCODER_PICTURE', 'OBJECT_IMAGES_TRANSCODER_GALLERY'),
+            'trans' => ['OBJECT_IMAGES_TRANSCODER_GALLERY', 'OBJECT_IMAGES_TRANSCODER_AVATAR'],
+            'trans_orig' => ['OBJECT_IMAGES_TRANSCODER_PICTURE', 'OBJECT_IMAGES_TRANSCODER_GALLERY'],
             'txt_ss' => 'txt_sample_pp_single',
             'txt_sswa' => 'txt_sample_pp_single_with_article',
             'txt_sa' => 'txt_sample_pi_action',
             'txt_sau' => 'txt_sample_pi_action_user'
-        ));
-        $aResult['allowed_view'] = array('module' => $this->_oConfig->getName(), 'method' => 'get_timeline_profile_picture_allowed_view');
+        ]);
+
+        if($aResult !== false)
+            $aResult['allowed_view'] = ['module' => $this->_oConfig->getName(), 'method' => 'get_timeline_profile_picture_allowed_view'];
 
         return $aResult;
     }
@@ -1212,18 +1214,20 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
         return $this->_serviceGetTimelineProfileImageAllowedView($aEvent);
     }
 
-    public function serviceGetTimelineProfileCover($aEvent, $aBrowseParams = array())
+    public function serviceGetTimelineProfileCover($aEvent, $aBrowseParams = [])
     {
-        $aResult = $this->_serviceGetTimelineProfileImage($aEvent, $aBrowseParams, array(
+        $aResult = $this->_serviceGetTimelineProfileImage($aEvent, $aBrowseParams, [
             'stg' => 'OBJECT_STORAGE_COVER',
-            'trans' => array('OBJECT_IMAGES_TRANSCODER_GALLERY', 'OBJECT_IMAGES_TRANSCODER_COVER_THUMB'),
-            'trans_orig' => array('OBJECT_IMAGES_TRANSCODER_COVER', 'OBJECT_IMAGES_TRANSCODER_GALLERY'),
+            'trans' => ['OBJECT_IMAGES_TRANSCODER_GALLERY', 'OBJECT_IMAGES_TRANSCODER_COVER_THUMB'],
+            'trans_orig' => ['OBJECT_IMAGES_TRANSCODER_COVER', 'OBJECT_IMAGES_TRANSCODER_GALLERY'],
             'txt_ss' => 'txt_sample_pc_single',
             'txt_sswa' => 'txt_sample_pc_single_with_article',
             'txt_sa' => 'txt_sample_pi_action',
             'txt_sau' => 'txt_sample_pi_action_user'
-        ));
-        $aResult['allowed_view'] = array('module' => $this->_oConfig->getName(), 'method' => 'get_timeline_profile_cover_allowed_view');
+        ]);
+
+        if($aResult !== false)
+            $aResult['allowed_view'] = ['module' => $this->_oConfig->getName(), 'method' => 'get_timeline_profile_cover_allowed_view'];
 
         return $aResult;
     }

+ 2 - 0
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -2749,6 +2749,8 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                 if(empty($aReposted) || !is_array($aReposted))
                     return array();
 
+                $aEventReposted['content'] = $aReposted['content'];
+
                 $aResult['content'] = array_merge($aContent, $aReposted['content']);
                 $aResult['content']['parse_type'] = !empty($aReposted['content_type']) ? $aReposted['content_type'] : BX_TIMELINE_PARSE_TYPE_DEFAULT;