Skip to content

Commit

Permalink
Ticket #3654 - The pre-moderated content doesn't appear in the Notifi…
Browse files Browse the repository at this point in the history
…cations...
  • Loading branch information
AntonLV committed Feb 25, 2022
1 parent 1e338ca commit 7fc36c8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions modules/base/text/classes/BxBaseModTextGridAdministration.php
Expand Up @@ -63,6 +63,31 @@ protected function _switcherState2Checked($mixedState)
return 'active' == $mixedState ? true : false;
}

protected function _enable ($mixedId, $isChecked)
{
$CNF = &$this->_oModule->_oConfig->CNF;

$bStatusAdmin = $this->_sStatusField == $CNF['FIELD_STATUS_ADMIN'];

$sStatusBefore = '';
if($bStatusAdmin) {
$aContentInfo = $this->_oModule->_oDb->getContentInfoById($mixedId);
if(!empty($aContentInfo) && is_array($aContentInfo))
$sStatusBefore = $aContentInfo[$this->_sStatusField];
}

$mixedResult = parent::_enable($mixedId, $isChecked);
if((int)$mixedResult > 0) {
if($bStatusAdmin && $sStatusBefore == BX_BASE_MOD_TEXT_STATUS_PENDING) {
$aContentInfo = $this->_oModule->_oDb->getContentInfoById($mixedId);
if($aContentInfo[$this->_sStatusField] == BX_BASE_MOD_TEXT_STATUS_ACTIVE)
$this->_oModule->onApprove($aContentInfo);
}
}

return $mixedResult;
}

protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
{
$CNF = &$this->_oModule->_oConfig->CNF;
Expand Down

0 comments on commit 7fc36c8

Please sign in to comment.