Project

General

Profile

Actions

Bug #98622

closed

Pass down local TypoScriptFrontendController when instantiating a new ContentObjectRenderer from RECORDS and CONTENT

Added by Andreas Kiessling over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2022-10-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Related to https://forge.typo3.org/issues/97638

The issue came up during setting up EXT:solr in TYPO3 11.5 to index content elements attached to an EXT:news record.
The content elements were not indexed due to the missing TSFE when CONTENT renders them. Seems like this was simply overlooked when the other issues were fixed.
https://github.com/TYPO3/typo3/blob/a710f8c4a101916735fe358b1b5d58ed659e936f/typo3/sysext/frontend/Classes/ContentObject/RecordsContentObject.php#L92
https://github.com/TYPO3/typo3/blob/a710f8c4a101916735fe358b1b5d58ed659e936f/typo3/sysext/frontend/Classes/ContentObject/ContentContentObject.php#L77

When a new ContentObjectRenderer is instantiated in RecordsContentObject and ContentContentObject, the frontendController instance must be passed down.
Not passing it down in RecordsContentObject results in missing content in solr, not passing it then down in ContentContentObject results in warnings when running the indexer from the scheduler in the backend.

I'm not really sure how to test this outside of the solr context, but i described my setup in https://github.com/TYPO3-Solr/ext-solr/issues/3358

You need EXT:solr and EXT:news with news records that have content elements attached to them.
The news indexer then needs to load the content elements, e.g. like this

content = SOLR_CONTENT
content {
    cObject = COA
    cObject {
        5 = TEXT
        5.field = teaser
        10 = TEXT
        10 {
            field = bodytext
            noTrimWrap = || |
        }

        20 = CONTENT
        20 {
            table = tt_content
            select {
                pidInList.field = pid
                orderBy = sorting
                languageField = sys_language_uid
                includeRecordsWithoutDefaultTranslation = 1
                where = {#tt_content.tx_news_related_news} = ###NEWS_UID###
                markers {
                    NEWS_UID.field = uid
                }
            }
        }
    }
}

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #97638: Use local TypoScriptFrontendController instead of $GLOBALS['TSFE'] in ContentObjectsClosed2022-05-16

Actions
Actions #1

Updated by Andreas Kiessling over 1 year ago

  • Description updated (diff)
Actions #2

Updated by Andreas Kiessling over 1 year ago

  • Related to Task #97638: Use local TypoScriptFrontendController instead of $GLOBALS['TSFE'] in ContentObjects added
Actions #3

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76121

Actions #4

Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76121

Actions #5

Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76174

Actions #6

Updated by Anonymous over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF