Bug #106346
openQueryResultPaginator does not respect ModifyQueryBeforeFetchingObjectDataEvent & ModifyResultAfterFetchingObjectDataEvent
0%
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
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
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?