#69941slide of cObject CONTENT don't work properly
Description
Hi!
I use a slide option in my extension https://forge.typo3.org/projects/extension-adx_twitter_bootstrap
with following TS setup:
styles.content.get {
select.pidInList = {field: mount_pid // field: this}
select.pidInList.insertData = 1
select.andWhere.dataWrap = ( tt_content.tx_adxtwitterbootstrap_inherit = 1 OR ( tt_content.tx_adxtwitterbootstrap_inherit = 2 AND tt_content.pid != {TSFE: contentPid} ) OR ( tt_content.tx_adxtwitterbootstrap_inherit = 0 AND tt_content.pid = {TSFE: contentPid} ) )
slide = -1
slide.collect = -1
slide.collectReverse = 0
slide.collectFuzzy = 0
}
This worked up to v6.2 properly. In v7.4.0 the content will be rendered twice even the option is not set.
The solution will be to reset the “$cobjValue” on the right place:
File: typo3/sysext/frontend/Classes/ContentObject/ContentContentObject.php
Line: 72
search:
if (!empty($records)) {
$this->cObj->currentRecordTotal = count($records);
$this->getTimeTracker()->setTSlogMessage('NUMROWS: ' . count($records));
/** @var $cObj ContentObjectRenderer */
$cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class);
$cObj->setParent($this->cObj->data, $this->cObj->currentRecord);
$this->cObj->currentRecordNumber = 0;
$cobjValue = '';
replace:
$cobjValue = '';
if (!empty($records)) {
$this->cObj->currentRecordTotal = count($records);
$this->getTimeTracker()->setTSlogMessage('NUMROWS: ' . count($records));
/** @var $cObj ContentObjectRenderer */
$cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class);
$cObj->setParent($this->cObj->data, $this->cObj->currentRecord);
$this->cObj->currentRecordNumber = 0;
Thanks a lot!