neos / flow-development-collection

The unified repository containing the Flow core packages, used for Flow development.
https://flow.neos.io/
MIT License
138 stars 188 forks source link

Undefined index in proxy class when defining a pointcut in inheritance #586

Open neos-bot opened 9 years ago

neos-bot commented 9 years ago

Jira issue originally created by user akii:

So this is a weird one. I've an aspect that defines 2 pointcuts:

@Flow\Around("method(TYPO3\Fluid\ViewHelpers\Form\AbstractFormViewHelper->renderHiddenIdentityField())")

and

@Flow\Around("method(TYPO3\Fluid\ViewHelpers\Form\HiddenViewHelper->render())")

HiddenViewHelper is a subtype of AbstractFormViewHelper.

After clearing the cache, the following notice occurs:

#1: Notice: Undefined index: TYPO3\Flow\Aop\Advice\AroundAdvice in TYPO3*Fluid_ViewHelpers_Form*AbstractFormViewHelper.php line 232

After reloading, everything works as expected. This can be reproduced by clearing the cache. Removing the pointcut for either the AbstractFormViewHelper or the HiddenViewHelper resolves the issue.

Jira-URL: https://jira.neos.io/browse/FLOW-367

neos-bot commented 9 years ago

Comment created by akii:

So the problem is as follows: Given A <: B <: C, if B has no advices any advices from C will not be evaluated. The referenced patch fixes half of the problem, namely where advices from parent classes were never evaluated.

The remaining problem is to make sure that the inheritance chain can reach all the way up and load advices. This is a bit more complicated as there are some classes that don't have proxy classes. At this time I don't see how this can be fixed without a major rewrite.

neos-bot commented 8 years ago

Comment created by @albe:

Currently discussing the current expected behaviour of advicing a method with a hierarchy call chain.

albe commented 6 years ago

Not sure this is still an issue, because the call chain of Aspects has been changed in so far, that it will now be called even if there are classes without proxy in the hierarchy. See #425