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

[BUGFIX] Handle possible DBALException #2153

Merged
merged 3 commits into from
Apr 2, 2024
Merged

[BUGFIX] Handle possible DBALException #2153

merged 3 commits into from
Apr 2, 2024

Conversation

JanStorm
Copy link
Contributor

@JanStorm JanStorm commented Mar 7, 2024

We can ignore a missing database connection at this point. We cant do anything about a missing database connection. This Scenario is possible during first install.

In a Scenario, where flux is installed before first install, this happens:

  1. Upon the last setup step, when finishing by sending the admin user credentials and some metadata, the BootCompletedEvent is fired which brings up the FluidTYPO3\Flux\Integration\Event\BootCompletedEventListener.
  2. The SpooledConfigurationApplicator then in its processData calls $this->spoolQueuedContentTypeRegistrations in Line 71.
  3. Then $this->contentTypeBuilder->registerContentType in Line 181 requires a Database Connection for registering the content types.
  4. Because the Database is not fully setup yet, DBAL returns a TableNotFoundException, which is a subclass of the more generic DBALException.
  5. This is nowhere caught and therefore we cant successfully end the first install process.

Tested in Typo3 11.5.36 with flux 10.0.9

We can ignore a missing database connection at this point. We cant do anything about a missing database connection. This Scenario is possible during first install.
@NamelessCoder
Copy link
Member

The exception appears to have a different class name on the version of Doctrine that's used by TYPO3v12. We'll need to handle the newer exception type, and if it isn't backwards compatible, handle both types and add the resulting warnings to the phpstan baseline.

@JanStorm
Copy link
Contributor Author

Thanks for looking into it! The exception class was deprecated and then renamed in the newest doctrine version. I've updated the catch case to a more specific class that exists in both the older and new versions of Doctrine.

@NamelessCoder NamelessCoder merged commit 066027a into FluidTYPO3:development Apr 2, 2024
12 checks passed
@NamelessCoder
Copy link
Member

Thanks for the update and the patch!

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.

2 participants