Skip to content

Commit

Permalink
Fixed Default Touch
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdkdkussin committed Jan 16, 2024
1 parent 1a65e9e commit c45c4f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion modules/kussin/chatgpt-content-creator/Cron/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ protected function _replaceContent() {
$oObject = $this->_getOxidObject($aItem[1]);
$sOxid = $aItem[2];
$sFieldId = $this->_getOxidFieldId($aItem[1], $aItem[3], $aItem[5]);
$sTouchTable = ( ($aItem[1] == 'oxartextends') ? 'oxarticles' : $aItem[1] );

$this->_debug('Current $sFieldId for Object ID ' . $sOxid . ': ' . $sFieldId);

switch (str_replace(array('_1', '_2', '_3', '_4', '_5'), '', $sFieldId)) {
case 'oxarticles__oxattribute':
Expand All @@ -237,7 +240,7 @@ protected function _replaceContent() {
case 'oxarticles__oxshortdesc':
case 'oxartextends__oxlongdesc':
case 'oxarticles__oxsearchkeys':
$sObjectLink = $this->_savingDefaultContentType($oObject, $aItem[2], $sFieldId, (int) $aItem[5], $aItem[6]);
$sObjectLink = $this->_savingDefaultContentType($oObject, $aItem[2], $sFieldId, (int) $aItem[5], $aItem[6], $sTouchTable);
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ trait SavingContentTypesTrait

protected $_aForbiddenValues = array('null', 'n/a', 'n.v.');

protected function _savingDefaultContentType($oObject, $sOxid, $sFieldId, $iLang, $sGeneratedContentHash) : string
protected function _savingDefaultContentType($oObject, $sOxid, $sFieldId, $iLang, $sGeneratedContentHash, $sTouchTable = 'oxarticles') : string
{
// DECODE CONTENT
$sGeneratedContent = $this->_decodeProcessContent($sGeneratedContentHash);
Expand All @@ -33,7 +33,7 @@ protected function _savingDefaultContentType($oObject, $sOxid, $sFieldId, $iLang
}

// TOUCH TIMESTAMP
$this->_touchTimestamp($sOxid, ( ($aItem[1] == 'oxartextends') ? 'oxarticles' : $aItem[1] ));
$this->_touchTimestamp($sOxid, $sTouchTable);

$oObject->save();

Expand Down

0 comments on commit c45c4f0

Please sign in to comment.