Project

General

Profile

Actions

Bug #106346

open

QueryResultPaginator does not respect ModifyQueryBeforeFetchingObjectDataEvent & ModifyResultAfterFetchingObjectDataEvent

Added by Andreas Sommer 14 days ago. Updated 7 days ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2025-03-10
Due date:
% Done:

0%

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

Description

Modifying queries with those 2 events, were not used in QueryResultPaginator

This problem is also for versions up to TYPO3 13 not solved


Files

add_events_to_QueryResultPaginator.patch (4.13 KB) add_events_to_QueryResultPaginator.patch Patch for v10 Andreas Sommer, 2025-03-10 09:14
Actions #1

Updated by Stefan Froemken 10 days ago

Hopefully it does not respect these Events.

You collect all data objects in your controller by:

$cars = $this->carRepository->findAll();

In $cars there are no collected records. No SQL query was executed. You only got a QueryResultObject with all information about a query. Nothing more.

And this query information object will be transferred to the QueryResultPagination. And still that object does NOT work with data records. It only changes the first record to use and the max amount of records to fetch. Nothing more.

First in your template, or when you are start looping through $cars, internally a query will be executed. And only then, both mentioned events will be called.

So, for me it does not make sence to move or copy over these events also to QueryResultPaginator.

I would prefer you to have a deeper look into your code why these events are not called the normal way. I have just checked Query::execute. Either with activated or deactivated $returnRawQueryResult both events are called. Please check your EventListener registration, flush cache in InstallTool, but it seems there is something broken in your environment

Actions #2

Updated by Georg Ringer 7 days ago

  • Status changed from New to Needs Feedback

totally agree to what Stefan says. does that work for you?

Actions

Also available in: Atom PDF