Browse Source

Ticket #4591 - Timeline: Source field should work with original Author ID.

AntonLV 2 years ago
parent
commit
3dce8e1f41

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

@@ -833,7 +833,7 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
 
         if(!empty($CNF['OBJECT_METATAGS']))
             $aParams['timeline_group'] = array(
-                'by' => $this->getName() . '_' . (int)$aContentInfo[$CNF['FIELD_AUTHOR']] . '_' . (int)$aContentInfo[$CNF['FIELD_ID']],
+                'by' => $this->getName() . '_' . abs((int)$aContentInfo[$CNF['FIELD_AUTHOR']]) . '_' . (int)$aContentInfo[$CNF['FIELD_ID']],
                 'field' => 'owner_id'
             );
 

+ 4 - 3
modules/boonex/channels/classes/BxCnlModule.php

@@ -51,7 +51,7 @@ class BxCnlModule extends BxBaseModGroupsModule
          * Usually it happens when tags were processed with cron.
          */
         if(empty($iAuthorId))
-            $iAuthorId = BxDolService::call($sModuleName, 'get_author', array($iContentId));
+            $iAuthorId = abs(BxDolService::call($sModuleName, 'get_author', array($iContentId)));
 
         $aCheck = checkActionModule($iAuthorId, 'create channel auto', $this->getName(), false);
         $mixedCnlId = $this->_oDb->getChannelIdByName($sHashtag);
@@ -86,7 +86,7 @@ class BxCnlModule extends BxBaseModGroupsModule
             'object_author_id' => $iAuthorId, 
             'privacy_view' => -$iCnlProfileId,
             'subobject_id' => $iId,
-			'content_module' => $sModuleName,
+            'content_module' => $sModuleName,
             'content_id' => $iContentId,
             'content_author_id' => $iAuthorId,
             'timeline_group' => array(
@@ -94,11 +94,12 @@ class BxCnlModule extends BxBaseModGroupsModule
                 'field' => 'owner_id'
             )
         ));
+
         $aParams = array(
             'object_author_id' => $iAuthorId, 
             'privacy_view' => -$iCnlProfileId, 
             'subobject_id' => $iId,
-			'content_module' => $sModuleName,
+            'content_module' => $sModuleName,
             'content_id' => $iContentId,
             'content_author_id' => $iAuthorId
         );

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

@@ -64,7 +64,7 @@ class BxTimelineResponse extends BxBaseModNotificationsResponse
                 if(!empty($oAlert->aExtras['timeline_group']))
                     $sSource = $oAlert->aExtras['timeline_group']['by'];
                 else
-                    $sSource = $oAlert->sUnit . '_' . $iObjectAuthorId . '_' . $oAlert->iObject;
+                    $sSource = $oAlert->sUnit . '_' . abs($iObjectAuthorId) . '_' . $oAlert->iObject;
 
                 $iDate = time();
                 $aEvent = [