Project

General

Profile

Actions

Feature #99323

closed

PSR-14 Event for manipulating records in ContentContentObject.php->render()

Added by Joey Bouten over 1 year ago. Updated 3 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Start date:
2022-12-09
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
PSR-14 Event
Complexity:
easy
Sprint Focus:

Description

Due to our use of `mod.web_layout.allowInconsistentLanguageHandling = 1` we encountered an issue that the sorting of the content elements in the front-end differs from the sorting in the backend.
Since we use strict mode incombination with allowing non-connected content elements in languages the sortings fails since it is always based on the sorting of the default language.

We fixed this in V10 by introducing a PSR-14 Event with-in a XClass.
Since `allowInconsistentLanguageHandling` is not officially supported by the core we do not expect a bugfix.
That is why we would like to introduce a PSR-14 Event in the render function like this.
So we can use the event to re-sort the elements with an asort.

......
do {
    $records = $this->cObj->getRecords($conf['table'], $conf['select.']);

    // START: THIS WAS CHANGED IN THE XCLASS IN THIS FUNCTION
    $eventDispatcher = GeneralUtility::makeInstance(EventDispatcher::class);
    $event = $eventDispatcher->dispatch(
        new ModifyRecordsAfterFetchingContentEvent($records, $conf)
    );
    $records = $event->getRecords();
    // END: THIS WAS CHANGED IN THE XCLASS IN THIS FUNCTION

    $cobjValue = '';
    if (!empty($records)) {
        $this->getTimeTracker()->setTSlogMessage('NUMROWS: ' . count($records));
......

I will provide a PR in the following days.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #102850: Fix FQCN in changelog for ModifyRecordsAfterFetchingContentEventClosedChris Müller2024-01-17

Actions
Actions #1

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/+/77274

Actions #2

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/+/77274

Actions #3

Updated by Gerrit Code Review over 1 year ago

Patch set 3 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/+/77274

Actions #4

Updated by Gerrit Code Review over 1 year ago

Patch set 4 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/+/77274

Actions #5

Updated by Gerrit Code Review over 1 year ago

Patch set 7 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/+/77274

Actions #6

Updated by Gerrit Code Review about 1 year ago

Patch set 8 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/+/77274

Actions #7

Updated by Gerrit Code Review about 1 year ago

Patch set 9 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/+/77274

Actions #8

Updated by Benni Mack about 1 year ago

  • Target version changed from 12 LTS to Candidate for Major Version
Actions #9

Updated by Gerrit Code Review 4 months ago

Patch set 10 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/+/77274

Actions #10

Updated by Gerrit Code Review 4 months ago

Patch set 11 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/+/77274

Actions #11

Updated by Gerrit Code Review 4 months ago

Patch set 12 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/+/77274

Actions #12

Updated by Gerrit Code Review 4 months ago

Patch set 13 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/+/77274

Actions #13

Updated by Gerrit Code Review 4 months ago

Patch set 14 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/+/77274

Actions #14

Updated by Joey Bouten 4 months ago

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

Updated by Chris Müller 4 months ago

  • Related to Task #102850: Fix FQCN in changelog for ModifyRecordsAfterFetchingContentEvent added
Actions #16

Updated by Benni Mack 3 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF