#91678Default validation of domain objects passed to extbase action causes massive performance load
Description
I experienced that a domain-object passed as a parameter to an action of an actionController in extbase receives the following treatment:
- all getters of the domain object are called
- all gettter of all sub-domain objects are called (even if lazy-loading is annoted in the model)
- all getters of all sub-sub-domain objects are called
WTF? Are you serious? This is the standard validation! If you not know as a developer, and you maybe do some stuff in your getter-functions (like overcome the flaws of the bad workspace implementation), and your model is a bit nested, you will eventually end up in thousands of function calls, and eventually thousands of queries (if you do queries in a getter for some reason).
In my views this has to be changed in a more lightweight standard validation procedure, or documented very prominently
There is a simple solution indeed, you can simply deactivate the validation of the action arguments, or replace by a different validation:
/**
* action werkdoks
*
* @param \SGPA\Sgpawerke\Domain\Model\WerkCategory $werkCategory
* @param \SGPA\Sgpawerke\Domain\Model\Werk $werk
* @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("werkCategory")
* @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("werk")
* @return void
*/
public function werkdoksAction(
\SGPA\Sgpawerke\Domain\Model\WerkCategory $werkCategory = NULL,
\SGPA\Sgpawerke\Domain\Model\Werk $werk = NULL
) {
...
...
}
In my example here, $werkCategory has 4-30 sub-items (werke), those have 1-10 sub-items (images). Imagine what happens with the standard” validation: a cascade of getterCalls… this can’t be really your intension…
Reviews 1
History 23
-
Mathias Schreiber changed Sprint Focus Remote Sprint <span data-processor="relativetime" data-value="2022-03-08T12:09:17+00:00" > 03/08/22, 12:09 </span>
-
Susanne Moog changed Complexity
no-brainermedium <span data-processor="relativetime" data-value="2022-04-04T08:31:03+00:00" > 04/04/22, 08:31 </span> -
Gerrit Code Review pushed patch set 1 for main to change 96335 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-02T20:25:49+00:00" > 10/02/26, 20:25 </span>