Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
akoenig-clickstorm opened this issue Aug 1, 2024 · 0 comments

Comments

@akoenig-clickstorm
Copy link

akoenig-clickstorm commented Aug 1, 2024

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

  • TYPO3 version(s): 12.4
  • news version: 11.4.2
  • Is your TYPO3 installation set up with Composer (Composer Mode): yes
  • OS: Linux Ubuntu

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.

@akoenig-clickstorm akoenig-clickstorm changed the title Call to undefined method with extended news model and NewsListEventListener Call to undefined method with extended news model and NewsListActionEventListener Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant