[BUGFIX] Only validate method params if needed 70/56970/7
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Tue, 15 May 2018 13:46:29 +0000 (15:46 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 22 May 2018 14:28:39 +0000 (16:28 +0200)
commit6ddfb9c584a0b08511642569c887e5c67b3b5b18
tree1fd4d4a8392d904774064744d082fbe1906029b8
parent6dd9f1aeb2a334bb76fe2d014c88c40192540d4c
[BUGFIX] Only validate method params if needed

Controller action arguments have been validated on
creation, which caused superfluous CPU cycles if the
action controller later detected, that an argument
should not have been validated at all due to an
@Extbase\IgnoreValidation annotation.

To fix this, arguments get an empty result on creation.
When setting the argument value, only the validation
results of the property mapping are merged with the
argument result.

ActionController::initializeActionMethodValidators does
only create validator instances for method arguments
that need to be validated, thus a whole bunch of checks
disappears in callActionMethod().

Releases: master
Resolves: #85012
Change-Id: Iaecf36718477a9216f8d36a993a137eb7b677227
Reviewed-on: https://review.typo3.org/56970
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-85012-OnlyValidateMethodParamsIfNeeded.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php
typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php
typo3/sysext/extbase/Classes/Mvc/Controller/Arguments.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentTest.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php