eventnews icon indicating copy to clipboard operation
eventnews copied to clipboard

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

Open Zillion01 opened this issue 4 years ago • 21 comments

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

Zillion01 avatar Jul 31 '20 08:07 Zillion01

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

kazsats avatar Aug 04 '20 06:08 kazsats

Clearing cache let it work just a while

Indeed. Anyone an idea? Really irritating crash bug.

Zillion01 avatar Aug 04 '20 14:08 Zillion01

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.

rasgor avatar Sep 11 '20 08:09 rasgor

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

bribbelbum avatar Sep 11 '20 10:09 bribbelbum

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.

rasgor avatar Sep 11 '20 13:09 rasgor

Also a fresh Typo3 10 without this typoscript snippet @bribbelbum

kazsats avatar Sep 14 '20 06:09 kazsats

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

bitmotionAE avatar Oct 29 '20 08:10 bitmotionAE

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?

flolanger avatar Feb 17 '21 16:02 flolanger

Same here, got that error on two different systems.

krausandre avatar Mar 03 '21 07:03 krausandre

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

georgringer avatar Mar 03 '21 18:03 georgringer

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

flolanger avatar Mar 04 '21 09:03 flolanger

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

georgringer avatar Mar 04 '21 12:03 georgringer

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

flolanger avatar Mar 04 '21 16:03 flolanger

Unfortunately i get also still the exception:

  • updated news to 8.5.2,
  • included the fix,
  • cleaned/flushed/rebuild cache/autoload etc but nah.

kazsats avatar Mar 16 '21 14:03 kazsats

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.

machwert avatar Apr 23 '21 09:04 machwert

yes use master of ext:news

georgringer avatar Apr 26 '21 09:04 georgringer

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.

machwert avatar Apr 29 '21 08:04 machwert

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

Zillion01 avatar Apr 29 '21 09:04 Zillion01

Current investigation progress (Anatomy of a page request):

  • Clearing the cache with typo3_console removes the DI Container
  • Reloading any TYPO3 FE/BE page will recreate the DI Container and therefore scan all directories in all Services.yml.
  • The DI Container resource scanning will trigger autoloading of classes, including \GeorgRinger\News\Domain\Model\News.
  • EXT:news/ext_localconf.php was not included at this point, so the ClassCacheManager::reBuild could not have been triggered.
  • If the reloaded page contains any Extbase Plugin TYPO3 will execute that Plugin, which interacts with Extbase
  • Extbase misses the ClassSchema and attempts to rebuild it.
  • Since the News class was already loaded during DI Container rebuild it will not be loaded anymore and ClassCacheManager::reBuild will not be called. The ClassSchema will be built with the original News class.

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:

  • I'm working on it.

vertexvaar avatar May 05 '21 09:05 vertexvaar

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?

vertexvaar avatar May 05 '21 14:05 vertexvaar

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

machwert avatar May 17 '21 01:05 machwert