Bug Report
Current Behavior
When extending GeorgRinger\News\Domain\Model\News via
$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['classes'] and defining initializeObject() in the extending class, TYPO3 crashes with:
Fatal error: Cannot redeclare GeorgRinger\News\Domain\Model\News::initializeObject() in var/cache/code/news/tx_news_domain_model_news.php
The generated proxy class contains initializeObject() more than once.
Expected behavior/output
Extending the News model with its own initializeObject() should not produce duplicate method declarations in the generated proxy class.
A single valid merged initializeObject() method (or another safe conflict handling) is expected.
Environment
- TYPO3 version(s): 14.1
- news version: 14.0.1
- Is your TYPO3 installation set up with Composer (Composer Mode): yes
- OS: Linux 6.8.0-64-generic with ddev
Possible Solution
Adjust ClassCacheManager add exception in merging for the function initializeObject() similar to the logic for __construct function
Additional context
I believe this problem was introduced when this PR was merged: #2722
Bug Report
Current Behavior
When extending
GeorgRinger\News\Domain\Model\Newsvia$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['classes']and defininginitializeObject()in the extending class, TYPO3 crashes with:Fatal error: Cannot redeclare GeorgRinger\News\Domain\Model\News::initializeObject() in var/cache/code/news/tx_news_domain_model_news.phpThe generated proxy class contains
initializeObject()more than once.Expected behavior/output
Extending the News model with its own
initializeObject()should not produce duplicate method declarations in the generated proxy class.A single valid merged
initializeObject()method (or another safe conflict handling) is expected.Environment
Possible Solution
Adjust ClassCacheManager add exception in merging for the function initializeObject() similar to the logic for __construct function
Additional context
I believe this problem was introduced when this PR was merged: #2722