Bug #31683

$joinPoint->getMethodArguments() looses the reference of the argument

Added by Fernando Arconada about 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
AOP
Target version:
-
Start date:
2011-11-08
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

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


Files

exception.png (472 KB) exception.png Fernando Arconada, 2011-11-08 16:22
#1

Updated by Fernando Arconada about 9 years ago

I forget the screenshot

#2

Updated by Bastian Waidelich about 9 years ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow
#3

Updated by Bastian Waidelich about 9 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 about 9 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 8 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.

Also available in: Atom PDF