Browse Source

Merge branch 'master' of https://github.com/unaio/una

AntonLV 5 năm trước cách đây
mục cha
commit
43e83688ba

+ 2 - 1
inc/classes/BxDolFeature.php

@@ -199,7 +199,8 @@ class BxDolFeature extends BxDolObject
     
     
     private function _prepareAuditParams()
     private function _prepareAuditParams()
     {
     {
-        $oModule = BxDolModule::getInstance($this->_aSystem['module']);
+        $sModule = $this->_aSystem['module'];
+        $oModule = BxDolModule::getInstance($sModule);
         if(!$oModule)
         if(!$oModule)
             return;
             return;
 
 

+ 6 - 3
modules/base/profile/classes/BxBaseModProfileFormsEntryHelper.php

@@ -100,9 +100,12 @@ class BxBaseModProfileFormsEntryHelper extends BxBaseModGeneralFormsEntryHelper
 
 
         list ($oProfile, $aContentInfo) = $this->_getProfileAndContentData($iContentId);
         list ($oProfile, $aContentInfo) = $this->_getProfileAndContentData($iContentId);
 
 
-        $sStatus = $oProfile->getStatus();
-        if (!$this->isAutoApproval(BX_DOL_PROFILE_ACTIVATE_EDIT) && BX_PROFILE_STATUS_ACTIVE == $sStatus)
+        $oEditedProfile = BxDolProfile::getInstanceMagic($aContentInfo['profile_id']);
+        
+        $sStatus = $oEditedProfile->getStatus();
+        if (!$this->isAutoApproval(BX_DOL_PROFILE_ACTIVATE_EDIT) && BX_PROFILE_STATUS_ACTIVE == $sStatus){
             $aTrackTextFieldsChanges = array ();
             $aTrackTextFieldsChanges = array ();
+        }
     }
     }
 
 
     public function onDataEditAfter ($iContentId, $aContentInfo, $aTrackTextFieldsChanges, $oProfile, $oForm)
     public function onDataEditAfter ($iContentId, $aContentInfo, $aTrackTextFieldsChanges, $oProfile, $oForm)
@@ -122,7 +125,7 @@ class BxBaseModProfileFormsEntryHelper extends BxBaseModGeneralFormsEntryHelper
         $oEditedProfile = BxDolProfile::getInstanceMagic($aContentInfo['profile_id']);
         $oEditedProfile = BxDolProfile::getInstanceMagic($aContentInfo['profile_id']);
         $sStatus = $oEditedProfile->getStatus();
         $sStatus = $oEditedProfile->getStatus();
 
 
-        if (!$this->isAutoApproval(BX_DOL_PROFILE_ACTIVATE_EDIT) && BX_PROFILE_STATUS_ACTIVE == $sStatus )
+        if (!$this->isAutoApproval(BX_DOL_PROFILE_ACTIVATE_EDIT) && BX_PROFILE_STATUS_ACTIVE == $sStatus && !empty($aTrackTextFieldsChanges['changed_fields']))
             $oEditedProfile->disapprove(BX_PROFILE_ACTION_AUTO, 0, $this->_oModule->serviceActAsProfile());
             $oEditedProfile->disapprove(BX_PROFILE_ACTION_AUTO, 0, $this->_oModule->serviceActAsProfile());
 
 
         // process uploaded files
         // process uploaded files