Issue Bug Closed

#76526Models passed to controller actions via UID have no lazy loading

Oliver Klee 06/08/16, 15:27 updated 06/24/23, 06:12

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

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.