Skip to content

[BUGFIX] Handle possible DBALException#2153

Merged
NamelessCoder merged 3 commits into
FluidTYPO3:developmentfrom
JanStorm:development
Apr 2, 2024
Merged

[BUGFIX] Handle possible DBALException#2153
NamelessCoder merged 3 commits into
FluidTYPO3:developmentfrom
JanStorm:development

Conversation

@JanStorm

@JanStorm JanStorm commented Mar 7, 2024

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
@NamelessCoder

Copy link
Copy Markdown
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