فهرست منبع

Ticket #4421 - Owner is incorrectly retrieve for Anonymous content.

AntonLV 3 سال پیش
والد
کامیت
d7f52f072e
1فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
  1. 7 3
      modules/base/general/classes/BxBaseModGeneralModule.php

+ 7 - 3
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -2409,13 +2409,17 @@ class BxBaseModGeneralModule extends BxDolModule
             }
             }
             else {
             else {
                 $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
                 $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
-                $oProfile = $aContentInfo ? BxDolProfile::getInstance($aContentInfo[$CNF['FIELD_AUTHOR']]) : null;
+                $iContentAuthor = (int)$aContentInfo[$CNF['FIELD_AUTHOR']];
+                if($iContentAuthor < 0)
+                    $iContentAuthor = abs($iContentAuthor);
+
+                $oProfile = $aContentInfo ? BxDolProfile::getInstance($iContentAuthor) : null;
             }
             }
+
             $iProfileId = $oProfile ? $oProfile->id() : bx_get_logged_profile_id();
             $iProfileId = $oProfile ? $oProfile->id() : bx_get_logged_profile_id();
         }
         }
-        else {
+        else
             $iProfileId = bx_get_logged_profile_id();
             $iProfileId = bx_get_logged_profile_id();
-        }
 
 
         return $iProfileId;
         return $iProfileId;
     }
     }