georgringer / news

TYPO3 Extension news
GNU General Public License v2.0
265 stars 355 forks source link

Call to undefined method with extended news model and NewsListActionEventListener #2512

Open akoenig-clickstorm opened 3 months ago

akoenig-clickstorm commented 3 months ago

Bug Report

Current Behavior There seems to be an issue within the ProxyClassGenerator, I have extended the base news model like described here: https://docs.typo3.org/p/georgringer/news/main/en-us/Tutorials/ExtendNews/ProxyClassGenerator/Index.html

Set up an EventListerner for the NewsListActionEvent and do a call on a extended model field in there. This results in the following error after clearing the cache via TYPO3 Backend: Call to undefined method GeorgRinger\News\Domain\Model\NewsInternal::getCsNewsExtendedBrands(). After loading the page a second time the error is gone but the method getCsNewsExtendedBrands returns null instead of an ObjectStorage.

When using typo3 cache:flush on CLI or clearing caches via the Install-Tool, the error is gone and everything works like expected. But as soon as I clear the general caches via TYPO3 backend, it will error again like described above.

Expected behavior/output Extending the base model and do a call on added method in NewsListActionEventListener should execute the method after clearing caches via TYPO3 Backend

Environment

Possible Solution use typo3 cache:flush on CLI or clear caches via Install-Tool but do not flush caches via backend.

Additional context I could upload my extended_news extension or the stacktrace if it helps tracking this issue down.