Bug #47309

Calling this in static context in cached classes

Added by Wouter Wolters over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Start date:
2013-04-17
Due date:
% Done:

0%

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

Description

When updating TYPO3 Flow 2.0 to the newest commit there is an Fatal error calling $this in static context.
For example the function "static public function getActionMethodParameters" is calling $this inside it's function.

After bisecting with git I found out that the problem is in 6d56d5f7

Running on the commit before this merge TYPO3 Flow is working.


Related issues

Is duplicate of TYPO3.Flow - Bug #47371: If matched AOP even wraps static methods which will fail on runtimeResolvedSteffen Ritter2013-04-19

Actions
#1

Updated by Alexander Berl over 8 years ago

Can't reproduce that with a fresh checkout from master and I also find no problematic code in that changeset on the first look. Could it be some commit merge problem? Can you possibly provide more debug information? For example a paste of the compiled proxy for TYPO3_Flow_Mvc_Controller_ActionController in your Data\Temporary\{Context}\Cache\Code\Flow_Object_Classes folder, the system log and the exact error message.

#2

Updated by Steffen Ritter over 8 years ago

Hey Wouter,
had that too - and this is because you use AOP with an advice catching all methods in a class.
College of mine did an "afterThrowing" to .*Controller->.*()

This wraps AOP Code around EVERY method within the controller - even static functions which won't work.

Why this "suddenly" happened is because of the introduced compile static performance optimisation which introduced static methods.

#3

Updated by Benno Weinzierl over 8 years ago

Is just stubled across the same problem. Be aware that also Policies are enforced through AOP wich make rules like this impossible:

'method(S2\Shop\Frontend\Controller\CheckoutController->.*(.*))'

i used

'method(S2\Shop\Frontend\Controller\CheckoutController->.*Action(.*))'

instead

#4

Updated by Robert Lemke over 8 years ago

  • Status changed from New to Closed
  • Target version set to 2.0

Solved in #47371

Also available in: Atom PDF