Bug #39791

Reflection data of old aspect is not removed

Added by Robert Lemke over 9 years ago. Updated over 8 years ago.

Must have
Start date:
Due date:
% Done:


Estimated time:
PHP Version:
Has patch:


The reflection data of a removed aspect is not removed by the file monitoring / reflection framework.

Steps to reproduce:

  1. create something which can be advised, for example a command controller with a command
  2. create a new aspect which advises that command, for example with an around advice
  3. check that this advice works
  4. rename the aspect class and the class file name
  5. run the advised command again

Expected result:

Uncaught Exception
  Warning: Invalid argument supplied for foreach() in Packages/Framework/TYPO3.FLOW3/Classes/Aop/Builder/ProxyClassBuilder.php
  line 315

The reason for the error message is that the old aspect class name is passed to buildAspectContainer() which tries to get the class methods but, as the class does not exist anymore, continues working with an invalid result.

It doesn't seem to be the fault of the file monitoring, because the file monitor does detect the change as you can see in the log file:

12-08-14 09:39:12 4799       INFO      FLOW3                Aspect classes have been modified, flushing the whole proxy classes cache.
12-08-14 09:39:12 4799       INFO      FLOW3                File Monitor "FLOW3_ClassFiles" detected 1 changed files and 0 changed directories.
12-08-14 09:39:12 4799       DEBUG     FLOW3                Reflected class names did not match class names to reflect
12-08-14 09:39:12 4799       DEBUG     FLOW3                Reflecting class Acme\Demo\Test2Aspect
12-08-14 09:39:12 4799       INFO      FLOW3                Reflected 1 emerged classes.

Also available in: Atom PDF