Issue Bug Closed

#95921Array to string conversion error in ContentObjectRenderer (PHP8)

Chris Müller 11/09/21, 12:29 updated 10/04/22, 14:13

Description

With the following configuration of a DatabaseQueryProcessor:

10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
    table = tx_myext_table
    where = parent=###pages_uid### and parenttable="pages"
    orderBy = sorting
    markers {
        pages_uid.field = uid
    }

    includeRecordsWithoutDefaultTranslation = 1
    as = records
}

The following error occurs:

PHP Warning: Array to string conversion in /var/www/html/public/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 6098

The problem here is that the orderBy part stored as an array:

[
    [
        'sorting',
        null
    ]
]

and used as $queryPartValue:

$queryPartValue = str_replace(‘###’ . $marker . ‘###’, $markerValue, $queryPartValue);

Reviews 2