Bug #31683
$joinPoint->getMethodArguments() looses the reference of the argument
Status: | Closed | Start date: | 2011-11-08 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | AOP | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | No | Affected Flow version: | Git master |
Description
For example
I have a aspect:
/** * Register every exception * * @FLOW3\AfterThrowing("class(F2\MyPackage\.*)") * @param \TYPO3\FLOW3\AOP\JoinPointInterface $joinPoint * @return void */ public function logException(\TYPO3\FLOW3\AOP\JoinPointInterface $joinPoint) { if ($joinPoint->hasException()) { $exception = $joinPoint->getException(); $this->logger->log('Excepcion: ' . $joinPoint->getClassName() . ' ' . $exception->getMessage()); } }
Now I tried to write a RoutePartHandler, the removeMatchingPortionFromRequestPath() uses one argument by reference.
class FileRoutePartHandler extends \TYPO3\FLOW3\MVC\Web\Routing\DynamicRoutePart{ protected function findValueToMatch($routePath) { $matches = array(); preg_match('/^[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/[a-z0-9\-]+/', $routePath, $matches); $result = (count($matches) === 1) ? current($matches) : ''; return $result; } }
Then FLOW3 fires an exception (see attachment)
If I disable the Aspect then It works
History
#2 Updated by Bastian Waidelich over 3 years ago
- Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow
#3 Updated by Bastian Waidelich over 3 years ago
- Category set to AOP
- Priority changed from Must have to Should have
- Has patch set to No
To add some information:
The exception is thrown because the target method expcets a reference and $joinPoint->getMethodArguments()
apparently looses the reference.
#4 Updated by Christopher Hlubek over 3 years ago
- Subject changed from $jointPoint->getMethodArguments() looses the reference of the argument to $joinPoint->getMethodArguments() looses the reference of the argument
#5 Updated by Christian Müller over 3 years ago
- Status changed from New to Closed
We have two more tickets for this, see https://review.typo3.org/#/c/9651/ so I close this, please refer to one of the other two tickets for further infos. Thanks you.