Bug #76526
closedModels passed to controller actions via UID have no lazy loading
0%
Description
From the Slack channel:
I encountered an issue that when an extbase model is passed into a controller action, it is always fully loaded (including all recursive associations), completely ignoring all "lazy" annotations. This can result in a lot of extra DB queries and thousands of models being created in memory. (My use case that I was displaying a category which had the following 1:n relations: category -> forums -> threads -> posts -> comments.) I think this is a bug. Either validation needs to stop at not-yet-loaded models (because we can assume them to be valid anyway), or @ignorevalidation should completely skip the validation. (Or even better, both.)
getObjectByIdentifier($identifier, $objectType = null, $useLazyLoading = false)
$object = $this->persistenceManager->getObjectByIdentifier($identity, $targetType);
tadaa
Files
Updated by Stefan Froemken over 1 year ago
- File Bildschirmfoto 2023-06-24 um 08.08.54.png Bildschirmfoto 2023-06-24 um 08.08.54.png added
- Status changed from New to Closed
Hello Olli,
thank you for this information. I remember that issue a long time ago, but can't reproduce it anymore. See picture here in issue ticket. As you can see, the LazyObjectStorage was not initialized anymore. So, for now, the problem is solved.
I will close the ticket now. If you feel this is the wrong decision, let me know, and I will re-open it.
Stefan