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

[TASK] Catch errors in schema generation and collect them #1008

Merged
merged 4 commits into from
Oct 3, 2024

Conversation

brotkrueml
Copy link
Contributor

There are cases when errors occur on iterating through the installed view helpers. The generation of the XSDs then break hard with an exception. Currently, this occurs with the TYPO3 extension "schema".

Now, these errors are catched and collected. A calling script can get and display these errors. This way, the generation of XSDs is not cancelled, but proceed without the erroneous view helpers.

This is especially useful for the TYPO3 command "fluid:schema:generate".

Related: #1005

Currently, the method exits hard on error with an exception with no way to recover.

Additionally, the TYPO3 command "fluid:schema:generate" can now display the
errors occured.
@brotkrueml
Copy link
Contributor Author

See also: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86360 for the consuming TYPO3 command.

@brotkrueml
Copy link
Contributor Author

Without the patch and adjusting the TYPO3 command the following exception is given on the first error rising (for EXT:schema):

Uncaught TYPO3 Exception Typed property Brotkrueml\Schema\Core\ViewHelpers\AbstractTypeViewHelper::$modelTemplate must not be accessed before initialization
thrown in file /home/chris/Projects/schema/Classes/Core/ViewHelpers/AbstractTypeViewHelper.php

The abstract view helpers uses a constructor which is not taken into account.

src/Schema/ViewHelperFinder.php Outdated Show resolved Hide resolved
@s2b s2b merged commit d2504c4 into TYPO3:main Oct 3, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants