#106346QueryResultPaginator does not respect ModifyQueryBeforeFetchingObjectDataEvent & ModifyResultAfterFetchingObjectDataEvent
Description
Modifying queries with those 2 events, were not used in QueryResultPaginator
This problem is also for versions up to TYPO3 13 not solved
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 1
History 4
-
Stefan Froemken commented 03/14/25, 16:14
-
Georg Ringer commented and changed status
NewNeeds Feedback 03/17/25, 18:48totally agree to what Stefan says. does that work for you?
-
Stefan Froemken commented and changed status
Needs FeedbackClosed 06/06/25, 06:19As there has been no feedback provided for the past three months, I will proceed to close this issue. If you need further assistance or wish to revisit this topic, please feel free to reopen the ticket at any time.
-
Andreas Sommer commented and changed TYPO3 Version
1012 PHP Version7.48.3 11/25/25, 10:01Hello,
from a technical standpoint, it is unclear why modifications made via ModifyQueryBeforeFetchingObjectDataEvent are not reflected in the pagination logic. The event’s name implies that the query is adjusted before the data retrieval process begins.
Since extending individual repositories is not a viable solution due to the scale and effort involved, it appears that this event is simply not being taken into account for pagination.
Is this behavior intended?
Best regards
Andreas
Hopefully it does not respect these Events.
You collect all data objects in your controller by:
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