RomanL vor 8 Jahren
Ursprung
Commit
d26badb53e
1 geänderte Dateien mit 12 neuen und 10 gelöschten Zeilen
  1. 12 10
      modules/boonex/channels/classes/BxCnlModule.php

+ 12 - 10
modules/boonex/channels/classes/BxCnlModule.php

@@ -44,17 +44,19 @@ class BxCnlModule extends BxBaseModGroupsModule
             if (0 == (int) $this->_oDb->checkContentInChannel($iContentId, $mixedCnlId, $sModuleName, $iAuthorId)){
                 $iId = $this->_oDb->addContentToChannel($iContentId, $mixedCnlId, $sModuleName, $iAuthorId);
                 $oModule = BxDolModule::getInstance($sModuleName);
-                $aInfo = $oModule->_getContent($iContentId);
-                if (is_array($aInfo)){
-                    $oDolProfileQuery = BxDolProfileQuery::getInstance();
-                    $iProfileInfo = $oDolProfileQuery->getProfileByContentAndType($mixedCnlId, $this->_aModule['name']);
-                    if(is_array($iProfileInfo)){
-                        $sPrivacyKey = 'allow_view_to';
-                        if ($sModuleName == 'bx_timeline'){
-                            $sPrivacyKey ='object_privacy_view';
+                if ($oModule){
+                    $aInfo = $oModule->_getContent($iContentId);
+                    if (is_array($aInfo)){
+                        $oDolProfileQuery = BxDolProfileQuery::getInstance();
+                        $iProfileInfo = $oDolProfileQuery->getProfileByContentAndType($mixedCnlId, $this->_aModule['name']);
+                        if(is_array($iProfileInfo)){
+                            $sPrivacyKey = 'allow_view_to';
+                            if ($sModuleName == 'bx_timeline'){
+                                $sPrivacyKey ='object_privacy_view';
+                            }
+                            bx_alert($this->_aModule['name'], 'hashtag_added', $iId, $iProfileInfo['id'], array('object_author_id' => $iAuthorId, 'privacy_view' => $aInfo[1][$sPrivacyKey]));
+                            bx_alert($this->_aModule['name'], 'hashtag_added_notif', $mixedCnlId, $iProfileInfo['id'], array('object_author_id' => $iAuthorId, 'privacy_view' => $aInfo[1][$sPrivacyKey], 'subobject_id' => $iId));
                         }
-                        bx_alert($this->_aModule['name'], 'hashtag_added', $iId, $iProfileInfo['id'], array('object_author_id' => $iAuthorId, 'privacy_view' => $aInfo[1][$sPrivacyKey]));
-                        bx_alert($this->_aModule['name'], 'hashtag_added_notif', $mixedCnlId, $iProfileInfo['id'], array('object_author_id' => $iAuthorId, 'privacy_view' => $aInfo[1][$sPrivacyKey], 'subobject_id' => $iId));
                     }
                 }
             }