brotkrueml / schema

TYPO3 extension providing an API and view helpers for schema.org markup
https://extensions.typo3.org/extension/schema
GNU General Public License v2.0
32 stars 9 forks source link

fluid:schema:generate - throw an exception #123

Open ryze-typo3-developer opened 1 month ago

ryze-typo3-developer commented 1 month ago

In TYPO3 v13.3 if i am on the console run "vendor/bin/typo3 fluid:schema:generate" it throw an exception:

Uncaught TYPO3 Exception Typed property Brotkrueml\Schema\Core\ViewHelpers\AbstractTypeViewHelper::$modelTemplate must not be accessed before initialization thrown in file /var/www/html/domains/ryze-typo3-standard/vendor/brotkrueml/schema/Classes/Core/ViewHelpers/AbstractTypeViewHelper.php in line 41

brotkrueml commented 1 month ago

@ryze-typo3-developer Thanks for your report. Sadly, this cannot be fixed easily on my side. If I adjust the $modelTemplate part another error occurs:

Uncaught TYPO3 Exception Call to a member function getPropertyNames() on null

It seems that the command also collects abstract view helper classes (which it shouldn't) - will have a look into the command.

brotkrueml commented 1 month ago

Okay, it is not the AbstractTypeViewHelper, but the first type view helper found: schema/Classes/ViewHelpers/Type/BeachViewHelper.php

brotkrueml commented 1 month ago

It is this part of code in \TYPO3Fluid\Fluid\Schema\ViewHelperMetadataFactory who produces the error:

(new \ReflectionClass($className))->newInstanceWithoutConstructor()->prepareArguments()
brotkrueml commented 1 month ago

Will take care, but have to think about this.

brotkrueml commented 1 month ago

First step: don't abort generating the XSDs: