Bug #25965
AOP ProxyClassBuilder always detects an aspect as "changed" if no Dependency Injection is used in this aspect (f.e. in LazyLoadingObjectAspect)
100%
Description
Problem¶
If there is an aspect A, which does not need dependency injection, and another class C is modified, the ProxyClassBuilder is incorrectly assuming that Aspect A has changed, and triggers a full rebuild of all AOP target classes.
From method build() in Aop/Builder/ProxyClassBuilder:$rebuildEverything = FALSE;
foreach (array_keys($this->aspectContainers) as $aspectClassName) {
if ($this->compiler->hasCacheEntryForClass($aspectClassName) === FALSE) {
$rebuildEverything = TRUE;
$this->systemLogger->log(sprintf('Aspect %s has been modified, therefore rebuilding all target classes.', $aspectClassName), LOG_INFO);
break;
}
}
for aspects which do not need Dependency Injection, "hasCacheEntryForClass" is always FALSE. This becomes clear when looking into the Object\Proxy\Compiler:
There, the cache is only written for classes where a proxy is needed.
Hotfix¶
It can be solved by adding empty Dependency Injection (though this is no real solution)... I am not sure how to solve this in a clean way, that's why I first wanted to document it here.
Related issues
Updated by Sebastian Kurfuerst almost 10 years ago
!!! When fixing this issue, make sure to revert http://review.typo3.org/1614 again!
Updated by Karsten Dambekalns almost 10 years ago
- Status changed from New to Accepted
- Assignee set to Karsten Dambekalns
Updated by Mr. Hudson almost 10 years ago
Patch set 1 of change I4182a91bdf02e6ffd93804d2df76095f12bb4508 has been pushed to the review server.
It is available at http://review.typo3.org/1633
Updated by Karsten Dambekalns almost 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b021a963cdcfc3b4e8cfbb07627a1a8cc64bf8ae.
Updated by Christopher Hlubek almost 10 years ago
The change handling is still not optimal, see #26107.