georgringer / eventnews

TYPO3 CMS Extension "eventnews" for displaying news as event in an calendar
Other
27 stars 60 forks source link

GeorgRinger\News\Domain\Model\News::isEvent could not be identified #102

Open Zillion01 opened 4 years ago

Zillion01 commented 4 years ago

The type of property GeorgRinger\News\Domain\Model\News::isEvent could not be identified, as property isEvent is unknown to the TYPO3\CMS\Extbase\Reflection\ClassSchema instance of class GeorgRinger\News\Domain\Model\News. Please make sure said property exists and that you cleared all caches to trigger a new build of said TYPO3\CMS\Extbase\Reflection\ClassSchema instance.

This error occurs every couple of page loads..

TYPO3 10.4.6 News 8.3.0 Eventnews 4.0.0

kazsats commented 4 years ago

Got the same error randomly.

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1580056272: The type of property GeorgRinger\News\Domain\Model\News::isEvent could not be identified, as property isEvent is unknown to the TYPO3\CMS\Extbase\Reflection\ClassSchema instance of class GeorgRinger\News\Domain\Model\News. Please make sure said property exists and that you cleared all caches to trigger a new build of said TYPO3\CMS\Extbase\Reflection\ClassSchema instance. | TYPO3\CMS\Extbase\Persistence\Generic\Mapper\Exception\NonExistentPropertyException thrown in file /html/typo3/typo3_src-10.4.6/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php in line 256.

Clearing cache let it work just a while

Typo3 10.4.6 PHP 7.2 News 8.3.0 Eventnews 4.0.0

Zillion01 commented 4 years ago

Clearing cache let it work just a while

Indeed. Anyone an idea? Really irritating crash bug.

rasgor commented 3 years ago

Same here,

TYPO3 10.4.8 PHP 7.3 News 8.4.0 Eventnews 4.0.0

After composer dump-autoload I can exactly display the news records for 1 time. After another reload it crashes.

bribbelbum commented 3 years ago

Hi,

Did you make update from TYPO3 8 or 9 to 10? If you load the following typoscript code anymore it could throw this error. This code musst be remove. If this code be loaded, you can easily watch with the typoscript object browser of the template module.

config.tx_extbase { objects { GeorgRinger\News\Domain\Model\Tag { className = Clickstorm\CsNewsExtend\Domain\Model\Tag } } persistence { classes { Clickstorm\CsNewsExtend\Domain\Model\Tag { mapping { tableName = tx_news_domain_model_tag } } } } }

Hope this helps. Björn

rasgor commented 3 years ago

In my case it is a freshly installed TYPO3 10 without old stuff. Currently I fixed it doing a downgrade of EXT:news from 8.4 to 8.3 and I'am not getting this error anymore.

kazsats commented 3 years ago

Also a fresh Typo3 10 without this typoscript snippet @bribbelbum

bitmotionAE commented 3 years ago

Has anyone found a solution yet? I get the same error randomly a while after having cleared the cache.

flolanger commented 3 years ago

I can confirm this issue is still present. For me, it only occurs so far when I clear the cache via TYPO3 Console (cli user). Can anyone help?

krausandre commented 3 years ago

Same here, got that error on two different systems.

georgringer commented 3 years ago

can you test this patch of news which would fix it? https://github.com/georgringer/news/compare/feature/cacherebuilding?expand=1 thx for feedback

flolanger commented 3 years ago

@georgringer I've tested the changes above, but sadly that didn't fix the problem. Same behavior as before (tested on same instance).

georgringer commented 3 years ago

The system cache needs to be cleared at least once before this should work

flolanger commented 3 years ago

@georgringer Yes, I did that. Also multiple times including normal backend cache clear and install-tool cache clear.

kazsats commented 3 years ago

Unfortunately i get also still the exception:

machwert commented 3 years ago

Does a workaround exist? Downgrading news to 8.3.0 (suggested by @rasgor) does not help in my case.

I use TYPO3 10, news 8.3.0 and eventnews 4.0.0.

georgringer commented 3 years ago

yes use master of ext:news

machwert commented 3 years ago

Thanks georgringer.

Unfortunately it didn't help. I updated news to 8.5.2 from master.

I still get the isEvent-Errors (every couple of hours) and this new error: Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1334756737: The temporary cache file "/typo3temp/var/cache/code/di/608a6f7fa1897579682971.temp" could not be written. | TYPO3\CMS\Core\Cache\Exception thrown in file /typo3cms/typo3_src-10.4.12/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php in line 232. Requested URL: https://www.test.de/autodiscover/autodiscover.xml

The isEvent error looks like this: The type of property GeorgRinger\News\Domain\Model\NewsDefault::isEvent could not be identified, as property isEvent is unknown to the TYPO3\CMS\Extbase\Reflection\ClassSchema instance of class GeorgRinger\News\Domain\Model\NewsDefault.

Zillion01 commented 3 years ago

Might be connected to https://forge.typo3.org/issues/75399 , sometimes the mapping is not available.

Maybe just avoid using the model in the code and use QueryBuilder with a viewHelper to fix this problem quickly.

Anyways I don't use this extension anymore and made some own code on top of EXT:News

vertexvaar commented 3 years ago

Current investigation progress (Anatomy of a page request):

Clearing the Cache in the Backend will not remove the DI Container. The next time any EXT:news class will be loaded the News autoloader will be already available and generate the "proxy class".

Solution proposal:

vertexvaar commented 3 years ago

So here's my proposal for a quick fix:

Exclude the models from the DI Container in EXT:news' Services.yaml.

  GeorgRinger\News\:
    resource: '../Classes/*'
    exclude: '../Classes/Domain/Model/*'

Impact on this issue: The News class will not get autoloaded during Container building/dumping. The first autoload attempt of this class will occurr after the News ClassLoader was registered.

Side effects: Well,... probably none. I haven't found any other bugs since but didn't test in depth, but it is bad practice to include Models in the DI Container anyway (I am aware that the TYPO3 documentation does not reflect this). The equivalent of Domain/Model in Symfony is Entity and that folder is excluded by default.

@georgringer Can you please confirm that this change does not break anything?

machwert commented 3 years ago

Thanks a lot @vertexvaar! The error is gone with your proposed changes in EXT:news' Services.yaml.